wez Sat Sep 10 17:38:07 2005 EDT
Added files: (Branch: PHP_5_1)
/php-src/ext/pdo_oci/tests bug_33707.phpt
Modified files:
/php-src/ext/pdo_oci oci_driver.c
Log:
closes #33707: error information was not passed up to PDO::query().
http://cvs.php.net/diff.php/php-src/ext/pdo_oci/oci_driver.c?r1=1.24&r2=1.24.2.1&ty=u
Index: php-src/ext/pdo_oci/oci_driver.c
diff -u php-src/ext/pdo_oci/oci_driver.c:1.24
php-src/ext/pdo_oci/oci_driver.c:1.24.2.1
--- php-src/ext/pdo_oci/oci_driver.c:1.24 Mon Jul 11 23:18:17 2005
+++ php-src/ext/pdo_oci/oci_driver.c Sat Sep 10 17:38:07 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci_driver.c,v 1.24 2005/07/12 03:18:17 wez Exp $ */
+/* $Id: oci_driver.c,v 1.24.2.1 2005/09/10 21:38:07 wez Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -144,6 +144,18 @@
}
}
+ if (stmt) {
+ /* always propogate the error code back up to the dbh,
+ * so that we can catch the error information when execute
+ * is called via query. See Bug #33707 */
+ if (H->einfo.errmsg) {
+ efree(H->einfo.errmsg);
+ }
+ H->einfo = *einfo;
+ H->einfo.errmsg = einfo->errmsg ? estrdup(einfo->errmsg) : NULL;
+ strcpy(dbh->error_code, stmt->error_code);
+ }
+
/* little mini hack so that we can use this code from the dbh ctor */
if (!dbh->methods) {
zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC,
"SQLSTATE[%s]: %s", *pdo_err, einfo->errmsg);
http://cvs.php.net/co.php/php-src/ext/pdo_oci/tests/bug_33707.phpt?r=1.1&p=1
Index: php-src/ext/pdo_oci/tests/bug_33707.phpt
+++ php-src/ext/pdo_oci/tests/bug_33707.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php