summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/mysql_statement.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-12-11 12:56:10 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-12-11 12:56:10 +0100
commitd09d930e48a3bccf0bd34d87656818072f064f82 (patch)
tree7119e3cd482543c760d6087c7d993aab327b584f /ext/pdo_mysql/mysql_statement.c
parent96ec26ec719388d095254794cc0cf2c8d8f2b9ad (diff)
parentad8eb116d831035584e178bffb85d68c1ca3d7fa (diff)
downloadphp-git-d09d930e48a3bccf0bd34d87656818072f064f82.tar.gz
Merge branch 'PHP-8.0'
* PHP-8.0: Fixed bug #67004
Diffstat (limited to 'ext/pdo_mysql/mysql_statement.c')
-rw-r--r--ext/pdo_mysql/mysql_statement.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index 80d8747cd9..9a9249d42f 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -303,7 +303,6 @@ static int pdo_mysql_stmt_execute_prepared_mysqlnd(pdo_stmt_t *stmt) /* {{{ */
PDO_DBG_RETURN(0);
}
- pdo_mysql_free_result(S);
PDO_DBG_RETURN(pdo_mysql_stmt_after_execute_prepared(stmt));
}
/* }}} */
@@ -316,14 +315,14 @@ static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt) /* {{{ */
PDO_DBG_ENTER("pdo_mysql_stmt_execute");
PDO_DBG_INF_FMT("stmt=%p", S->stmt);
+ /* ensure that we free any previous unfetched results */
+ pdo_mysql_free_result(S);
S->done = 0;
+
if (S->stmt) {
PDO_DBG_RETURN(pdo_mysql_stmt_execute_prepared(stmt));
}
- /* ensure that we free any previous unfetched results */
- pdo_mysql_free_result(S);
-
if (mysql_real_query(H->server, stmt->active_query_string, stmt->active_query_stringlen) != 0) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);