summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/mysql_statement.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-12-09 17:24:30 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-12-09 17:24:30 +0100
commit106e7e4bca7c0fd975eb219b18e3c34957ba8657 (patch)
tree81d0b1f96f78994a5f9783fc3b2fbd08a52789a0 /ext/pdo_mysql/mysql_statement.c
parentfcfa7fd06b8b298b6946ec0bf2b2440dd8f5d895 (diff)
downloadphp-git-106e7e4bca7c0fd975eb219b18e3c34957ba8657.tar.gz
Fixed bug #70066
If we fall back to emulated prepared statements, destroy S->stmt, so the code doesn't get confused about which mode we're in.
Diffstat (limited to 'ext/pdo_mysql/mysql_statement.c')
-rw-r--r--ext/pdo_mysql/mysql_statement.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index f6d460c82b..005f5890ab 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -31,11 +31,9 @@
#ifdef PDO_USE_MYSQLND
# define pdo_mysql_stmt_execute_prepared(stmt) pdo_mysql_stmt_execute_prepared_mysqlnd(stmt)
# define pdo_free_bound_result(res) zval_ptr_dtor(res.zv)
-# define pdo_mysql_stmt_close(stmt) mysqlnd_stmt_close(stmt, 0)
#else
# define pdo_mysql_stmt_execute_prepared(stmt) pdo_mysql_stmt_execute_prepared_libmysql(stmt)
# define pdo_free_bound_result(res) efree(res.buffer)
-# define pdo_mysql_stmt_close(stmt) mysql_stmt_close(stmt)
#endif
@@ -56,7 +54,7 @@ static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */
S->einfo.errmsg = NULL;
}
if (S->stmt) {
- pdo_mysql_stmt_close(S->stmt);
+ mysql_stmt_close(S->stmt);
S->stmt = NULL;
}
@@ -363,7 +361,7 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
}
#ifdef PDO_USE_MYSQLND
- if (!H->emulate_prepare) {
+ if (S->stmt) {
if (mysqlnd_stmt_next_result(S->stmt)) {
pdo_mysql_error_stmt(stmt);
S->done = 1;