Re: PHP 4.0 Bug #6033 Updated: Can't open more than one non-persistent connections to the same database

From: Date: Sun, 13 Aug 2000 13:24:27 +0000
Subject: Re: PHP 4.0 Bug #6033 Updated: Can't open more than one non-persistent connections to the same database
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-28751@lists.php.net to get a copy of this message
Hello Manuel, > - ifx_errormsg() is causing memory leaks under both PHP3 and PHP4. You > need to compile PHP enabling debug output to see this. These are not "real" memory leaks. It is memory that is allocated by the driver for the return value following the PHP guidelines using the PHP "emalloc()" function. This memory is released by the PHP engine on script end. The debug build warns you because it could be real memory leaks. I can suppress the warnings by using a variable on the stack, and letting PHP copy the variable to the return value. This way the memory belongs to PHP and you get no warnings on script end. The net result is the same except for the warnings. > > - When you call ifx_errormsg() after closing a connection in PHP3 it > returns that connection does not exist but this does not happen under > under PHP4. Isn't ifx_errormsg() supposed to return the last error > message even if a connection is not established? > The current ifx.ec in the PHP3 CVS does not need a valid a connection for ifx_errormsg(). PHP3 used (3.0.7 or so) to check for an existing connection in ifx_error() , but I removed that check long ago. You can still pass a connection id to ifx_error(), but it is ignored. As far as I know ifx_errormsg() never needed a connection, it does not take a connection id as parameter but an optional error code. If you don't pass an error code, it uses the last Informix error code if set, or SQLCODE. So if ifx_errormsg() returns the error message "connection does not exist", it means that this is *really* the last Informix error that occurred, and that for some reason or other the PHP3 ifx driver tried to access the connection you closed earlier, perhaps in the list destructor trying to close an already closed connection (bug). Danny ---

« previous php.dev (#28751) next »