Mantis - Quercus
Viewing Issue Advanced Details
4292 major always 11-14-10 17:02 11-14-10 17:02
db  
 
normal  
new 4.0.13  
open  
none    
none  
0004292: PDO constructor fails to throw PDOException
In native PHP, connection errors experienced during a call to the PDO constructor trigger a PDOException which can be caught and handled by the application; in Quercus, however, only a "warning" message is emitted and the application incorrectly proceeds as though nothing has gone wrong.

This behaviour has been confirmed in Quercus 4.0.7 as distributed within Resin 4.0.13.

This bug can be easily demonstrated with the attached code; under native PHP the output is:

Error! SQLSTATE[08006] [7] FATAL: no pg_hba.conf entry for host "127.0.0.1", user "wrong-user", database "mydb", SSL off

Unfortunately with Quercus, the output is:

/opt/resin/var/www/webapps/testphp/PDOExceptionTest.php:10: Warning: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "wrong-user", database "mydb", SSL off
PDO connection success!

This bug is proving to be a show-stopper as it is allowing PHP code to continue running under the false belief that the PDO connection was successful.
 PDOExceptionTest.php [^] (540 bytes) 11-14-10 17:02

There are no notes attached to this issue.