From d7393d2d02dd13c35328716067ee4ad9f37ee9ec Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Wed, 1 Feb 2006 09:10:23 +0000 Subject: [PATCH] fix build --- ext/pdo/pdo_dbh.c | 2 +- ext/pdo/php_pdo_driver.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 0d3fbc5c364..d66e15cbde3 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -72,7 +72,7 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate if (dbh->error_mode != PDO_ERRMODE_EXCEPTION) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message); } else { - zval *ex, info; + zval *ex, *info; zend_class_entry *def_ex = php_pdo_get_exception_base(1 TSRMLS_CC), *pdo_ex = php_pdo_get_exception(TSRMLS_C); MAKE_STD_ZVAL(ex); diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index 86ecfcc0e80..66b04dd44b1 100755 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -489,6 +489,13 @@ struct _pdo_dbh_t { zend_class_entry *def_stmt_ce; zval *def_stmt_ctor_args; + + /* when calling PDO::query(), we need to keep the error + * context from the statement around until we next clear it. + * This will allow us to report the correct error message + * when PDO::query() fails */ + pdo_stmt_t *query_stmt; + zval query_stmt_zval; }; /* describes a column */