summaryrefslogtreecommitdiff
path: root/ext/pdo/php_pdo_int.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo/php_pdo_int.h')
-rwxr-xr-xext/pdo/php_pdo_int.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h
index b0b6525412..e7c2487b58 100755
--- a/ext/pdo/php_pdo_int.h
+++ b/ext/pdo/php_pdo_int.h
@@ -57,7 +57,13 @@ extern pdo_driver_t *pdo_find_driver(const char *name, int namelen);
extern void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC);
-#define PDO_DBH_CLEAR_ERR() strcpy(dbh->error_code, PDO_ERR_NONE)
+#define PDO_DBH_CLEAR_ERR() do { \
+ strcpy(dbh->error_code, PDO_ERR_NONE); \
+ if (dbh->query_stmt) { \
+ dbh->query_stmt = NULL; \
+ zend_objects_store_del_ref(&dbh->query_stmt_zval TSRMLS_CC); \
+ } \
+} while (0)
#define PDO_STMT_CLEAR_ERR() strcpy(stmt->error_code, PDO_ERR_NONE)
#define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NULL TSRMLS_CC); }
#define PDO_HANDLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt TSRMLS_CC); }