From: s dot tretter at szene1 dot at
Operating system: linux
PHP version: 5.3CVS-2008-11-23 (CVS)
PHP Bug Type: MySQLi related
Bug description: mysqlnd: can't extend mysqli
Description:
------------
If you extend a class with mysqli (using the mysqlnd driver) and try to
connect to the database, php produces strange error messages.
PHP 5.3.0alpha3-dev (cli) (built: Nov 23 2008 12:06:30)
and --with-mysqli=mysqlnd
In php 5.2 and lower this test class works perfect.
Reproduce code:
---------------
<?php
class a extends mysqli
{
public function __construct() {
$dbParam = array ('DB_HOST' => 'localhost',
'DB_USER' => 'db',
'DB_PASS' => '',
'DB_NAME' => 'test'
);
$this->init();
$this->options(MYSQLI_OPT_CONNECT_TIMEOUT, 1);
$this->real_connect( $dbParam['DB_HOST'],
$dbParam['DB_USER'],
$dbParam['DB_PASS'],
$dbParam['DB_NAME']);
}
}
$mysqli = new a();
printf ("Connection: %s\n.", $mysqli->host_info);
$mysqli->close();
?>
Expected result:
----------------
should work like in php5.2
Actual result:
--------------
Warning: mysqli::options() [mysqli.options]: Couldn't fetch a in test.php
on line 31
Warning: mysqli::real_connect() [mysqli.real-connect]: Couldn't fetch
test.php on line 41
--
Edit bug report at http://bugs.php.net/?id=46653&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46653&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46653&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46653&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46653&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=46653&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46653&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=46653&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=46653&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=46653&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=46653&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=46653&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46653&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46653&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46653&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46653&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46653&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=46653&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=46653&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=46653&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=46653&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=46653&r=mysqlcfg