Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.6.0RC2
-
Fix Version/s: 1.8.2
-
Component/s: Zend_Db_Adapter_Mysqli
-
Labels:None
Description
On Zend/Db/Adapter/Mysqli.php, around line 302 :
@$this->_connection = new mysqli(
$this->_config['host'],
$this->_config['username'],
$this->_config['password'],
$this->_config['dbname'],
$port
);
if ($this->_connection === false || mysqli_connect_errno()) {
....
}
I'm using this, but I'm using too many links at the same time (the error that mysqlclient is returning is "Too many open links". BUT $this->_connection is not false (new mysqli() is returning mysqli Object ( ) as if everything was OK), and mysqli_connect_errno() does not return anything.
There should be a better control to check whether the connection is absolutely perfect or not. I personnaly think that this may be a PHP bug (new mysqli() should return false), but I posted it here in case.
php.ini config, related to Mysqli :
[mysqli]
mysqli.max_links = 3
mysqli.reconnect = On
Issue Links
| This issue is related to: | ||||
| ZF-5342 | Mysqli::__connect() forget to reset internal mysqli _connection object when connection failed |
|
|
|
I made some additional tests.
When the connection is OK, new mysqli() is returning a mysqli Object().
When the error appears, the same object is returned, but cannot be used. Example :
real_escape_string() [function.mysqli-real-escape-string]: Couldn't fetch mysqli in Zend/Db/Adapter/Mysqli.php on line 114