PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » MDB2 » Bug #3824

Endless loop when __construct is called

Details

Submitted2005-03-15 12:12 UTC
Fromlars at easykaktus dot de
StatusBogus
PackageMDB2
PHP Version5.0.3
OSLinux
Roadmaps(Not assigned)

Comments

[2005-03-15 12:12 UTC] lars at easykaktus dot de

Description:
------------
Having massive problems with beta3. __construct calls __construct in eg. mysql-Driver which is leading to an endless loop of constructors

Bug occurs in PHP 5.0.3, upgraded to 5.10-dev and there it works?!

Reproduce code:
---------------
$dsn = array(
"phptype" => 'mysql'
"username" => 'test'
"password" => 'test'
"hostspec" => 'localhost'
"database" => 'test'
);

$db =& MDB2::connect($dsn);

Expected result:
----------------
A connect to a database

[2005-03-15 12:23 UTC] smith at backendmedia dot com

I dont see how there could be an infinate loop from looking at the code (was looking at CVS, but I dont remember making any changes to the CVS in the constructors). Could you also give PHP 5.0.4 a try?

[2005-03-15 12:49 UTC] lars at easykaktus dot de

Sorry, seems the bug is not in MDB2beta3 but in eaccelerator 0.92a. After disabling eaccelerator MDB2beta3 works fine, but with eaccelerator enabled I get this (via xDebug):

Fatal error: Maximum function nesting level of '100' reached, aborting! in /usr/local/lib/php/MDB2/Driver/mysql.php on line 1073

4 MDB2->connect() /data/www/schafft-cms/lib/SDB.inc.php:41
5 MDB2->factory() /usr/local/lib/php/MDB2.php:343
6 MDB2_Driver_mysql->__construct() /usr/local/lib/php/MDB2.php:301
7 MDB2_Driver_Common->MDB2_Driver_Common() /usr/local/lib/php/MDB2/Driver/mysql.php:71
8 MDB2_Driver_mysql->__construct() /usr/local/lib/php/MDB2.php:1073
9 MDB2_Driver_Common->MDB2_Driver_Common() /usr/local/lib/php/MDB2/Driver/mysql.php:71
10 MDB2_Driver_mysql->__construct() /usr/local/lib/php/MDB2.php:1073
11 MDB2_Driver_Common->MDB2_Driver_Common() /usr/local/lib/php/MDB2/Driver/mysql.php:71
12 MDB2_Driver_mysql->__construct() /usr/local/lib/php/MDB2.php:1073
13 MDB2_Driver_Common->MDB2_Driver_Common() /usr/local/lib/php/MDB2/Driver/mysql.php:71
14 MDB2_Driver_mysql->__construct() /usr/local/lib/php/MDB2.php:1073
15 MDB2_Driver_Common->MDB2_Driver_Common() /usr/local/lib/php/MDB2/Driver/mysql.php:71
16 MDB2_Driver_mysql->__construct() /usr/local/lib/php/MDB2.php:1073

and so on.

I should wait for stable releases ;-)

Thanks for developing MDB2 and keep on the great work!

[2005-03-15 12:52 UTC] smith at backendmedia dot com

reporter notes its a bug in "eaccelerator" not MDB2