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.

I can confirm this issue at least on PHP 5.2.6 / Linux. As you said it happens only when the connection is not effective (failed because database not reachable, invalid login...). I don't agree with you on the fact that this is probably a PHP MySQLi related issue.

The problem is that when calling Zend_Db_Adapter_MySQLi::_connect(), we forget to unset the problematic mysqli object, let's see in ZF1.7.1 ::

if ($this->_connection === false || mysqli_connect_errno()) {
// THE connection error was given with mysqli_connect_errno, the value of $this->_connection is a "invalid" mysqli object. So I reset it
$this->_connection = false;
require_once 'Zend/Db/Adapter/Mysqli/Exception.php';
throw new Zend_Db_Adapter_Mysqli_Exception(mysqli_connect_error());
}

I'll post a separate bug report for this issue, hope this solution works

Thanks

Seb

Posted by old of Satoru Yoshida (yoshida@zend.co.jp) on 2009-05-11T23:07:09.000+0000

Is this still active?
The description seems to be outdated.

Posted by old of Satoru Yoshida (yoshida@zend.co.jp) on 2009-05-15T18:28:50.000+0000