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-10 09:58:47 +0100
commitf3d5877845358d011174cf87283b456cee6f7f53 (patch)
tree9160a407ac79b63f2130b5fa6bca51f83a866e1b /ext/pdo_mysql/mysql_statement.c
parent44b234a9bc589ee6c4afe3e1c386d536f750abe2 (diff)
downloadphp-git-f3d5877845358d011174cf87283b456cee6f7f53.tar.gz
Backport fix for bug #70066
Given the number of duplicates this bug report had, it seems worthwhile to fix this on PHP-7.4 as well. Cherry-pick of 106e7e4bca7c0fd975eb219b18e3c34957ba8657.
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 b2c37dcfec..beb559f0c1 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -33,11 +33,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
@@ -58,7 +56,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;
}
@@ -352,7 +350,7 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
PDO_DBG_INF_FMT("stmt=%p", S->stmt);
#if PDO_USE_MYSQLND
- if (!H->emulate_prepare) {
+ if (S->stmt) {
if (!mysqlnd_stmt_more_results(S->stmt)) {
PDO_DBG_RETURN(0);
}