Bug Report #3608

Kohana_Database_MySQL::connect() problem

Added by Stuart Harland over 3 years ago. Updated almost 3 years ago.

Status:ClosedStart date:01/16/2011
Priority:NormalDue date:
Assignee:Chris Bandy% Done:

100%

Category:-
Target version:Kohana v3.x - v3.0.12
Resolution:fixed Points:

Description

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 ]

Associated revisions

Revision f7433b1c
Added by Chris Bandy almost 3 years ago

Use message and code from the generated exception. Fixes #3608

History

#1 Updated by Jeremy Bush over 3 years ago

  • Target version set to v3.0.10

#2 Updated by Jeremy Bush about 3 years ago

  • Target version changed from v3.0.10 to v3.0.11

#3 Updated by Jeremy Bush almost 3 years ago

  • Target version changed from v3.0.11 to v3.0.12

#4 Updated by Chris Bandy almost 3 years ago

  • Status changed from New to Closed
  • Assignee set to Chris Bandy
  • % Done changed from 0 to 100
  • Resolution set to fixed

Also available in: Atom PDF