php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7298 ... not a valid link resource... after pg_connect
Submitted: 2000-10-17 18:15 UTC Modified: 2001-02-13 11:56 UTC
From: aja at nlgroup dot ca Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 4.0.3pl1 OS: x86 solaris
Private report: No CVE-ID: None
 [2000-10-17 18:15 UTC] aja at nlgroup dot ca
(Found the problem and fixed it.)
In some script sequences (can send code if necessary) the routine to set the default link in pgsql.c deletes the link before setting it - specifically, if a script issues multiple opens of the same connection string through an included file only.

php_pgsql_set_default_link has a check if PGG(default_link)!=-1. If true, then it does zend_list_delete of old default link and sets new one. If the old default link and new are the same, this sometimes sets the default to an invalid link.

Code should be :
if (PGG(default_link)!=-1) {
  if (PGG(default_link)==id) return;
...

Compiled it, and the problem is fixed. Checked postgresql connections, and they aren't multiplying.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-13 11:56 UTC] thies@php.net
fixed in CVS. thanx for the patch!

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 03:01:29 2024 UTC