summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/mysql_statement.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-12-09 11:13:48 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-12-09 11:13:48 +0100
commit18517e7a635e68969ed926f159bb66fb89d5cd3b (patch)
treee0ac58efc2a5c01aa78270941c8a88bc415c452a /ext/pdo_mysql/mysql_statement.c
parent9c0712d2cd9f4eab05c0ff73e054a646cd070188 (diff)
downloadphp-git-18517e7a635e68969ed926f159bb66fb89d5cd3b.tar.gz
Fix stmt_free_result implementation and usage
Two bugs both affecting the bug_pecl_7976.phpt test ("works with mysqlnd" haha): * We should not change the connection state in stmt_free_result. This makes mysql_stmt_free_result usable under mysqlnd and not just libmysqlclient. * If we call mysql_stmt_free_result, we still need to consume any outstanding result sets.
Diffstat (limited to 'ext/pdo_mysql/mysql_statement.c')
-rw-r--r--ext/pdo_mysql/mysql_statement.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index 9d544b23c2..e82cc6ddcc 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -893,9 +893,7 @@ static int pdo_mysql_stmt_cursor_closer(pdo_stmt_t *stmt) /* {{{ */
S->result = NULL;
}
if (S->stmt) {
- int retval;
- retval = mysql_stmt_free_result(S->stmt);
- PDO_DBG_RETURN(retval ? 0 : 1);
+ mysql_stmt_free_result(S->stmt);
}
while (mysql_more_results(S->H->server)) {