ID: 33707 Updated by: [EMAIL PROTECTED] Reported By: mangst at inventec dot ch -Status: Open +Status: Assigned Bug Type: PDO related Operating System: Windows 2000 PHP Version: 5CVS-2005-07-14 (dev) -Assigned To: +Assigned To: wez New Comment:
That happens because Oracle's OCIStmtPrepare() doesn't validate the query, it just allocates/prepares stmt handle for execution. Then PDO happily executes this statement and all errors go to the stmt handle (which is destroyed right after that). Wez, from what I can see, with OCI we should always copy einfo struct from the stmt handle to the dbh handle if stmt's execution failed. Thoughts? Previous Comments: ------------------------------------------------------------------------ [2005-07-14 22:07:02] mangst at inventec dot ch Description: ------------ When a SQL statement is executed with PDO::query, PDO::errorInfo[0] always reports "00000" even when an error has occurred and PDO::query returned <false>. Reproduce code: --------------- <?php try { $db = new PDO('oci:dbname=***', '***', '***'); } catch (PDOException $e) { exit ("Failed to obtain db handle: " . $e->getMessage()); } $rs = $db->query('select nvarchar(8) from dual'); echo 'Statement handle: '; var_dump($rs); echo "<br />\r\nError info of database handle: "; var_dump($db->errorInfo()); $db = null; ?> Expected result: ---------------- Somthing like: Statement handle: bool(false) Error info of database handle: array(1) { [0]=> string(5) "42000" [1]=> "????" [2]=> string(x) "ORA-00904: "NVARCHAR": invalid identifier"} Actual result: -------------- Statement handle: bool(false) Error info of database handle: array(1) { [0]=> string(5) "00000" } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33707&edit=1