Bug Report #3608
|Assignee:||Chris Bandy||% Done:|
|Target version:||Kohana v3.x - v3.0.12|
both mysql_connect() and mysql_pconnect() (especially the latter - an example is the first comment on the PHP manual page for that function) can raise PHP errors under certain circumstances that lead to nothing being returned for mysql_error() and mysql_errno(). Because the catch block throws the ErrorException away and generates a Database_Exception using the mysql error functions, you ultimately end up with a stack trace where you can't detect the cause of the error. You can of course quickly deduce where the error was, but not its actual cause.
I would suggest something along the lines of testing mysql_errno() for 0 in the catch block and then doing something different...
The current exception is thrown at:
MODPATH\database\classes\kohana\database\mysql.php [ 67 ]