|
|
|
@ -144,6 +144,18 @@ ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, swor |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
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); |
|
|
|
|