Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.1.4, 4.2.0, 4.3.0beta1
-
None
Description
Running the testsuite with mysqli:// and with Xdebug loaded (1) generates an "E" at every test with a message like:
mysqli_close(): Couldn't fetch mysqli
Without a master/slave configuration, the connection is initiated once and closed twice by the eZMySQL(i?)DB::close() function which causes a PHP error.
The error doesn't appear using mysql:// for the reason that an issue exist with the mysql functions and copying the link by reference (which is still the case in /lib/ezdb/classes/ezmysqldb.php:96):
The following code snippet will not issue an error
$c = mysql_connect('localhost', 'root', '*****' ); $d =& $c; $e = $d; mysql_close( $d ); mysql_close( $c );
Commenting: $e = $d and running this code again will give you the (expected) error:
Warning: mysql_close(): 4 is not a valid MySQL-Link resource in /home/patrick.allaert/test.php on line 7
(1) the fact that it doesn't produce an error without Xdebug inside ezp code is completely unknown. The above test case works consistently with or without Xdebug loaded.
Attachments
Issue Links
- is duplicated by
-
EZP-13007 Database warning, while closing the connection in cli script for ezmysqli support
- Closed