mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
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.
This commit is contained in:
parent
9c0712d2cd
commit
18517e7a63
3 changed files with 1 additions and 9 deletions
|
@ -1931,10 +1931,6 @@ MYSQLND_METHOD(mysqlnd_stmt, free_result)(MYSQLND_STMT * const s)
|
|||
stmt->state = MYSQLND_STMT_PREPARED;
|
||||
}
|
||||
|
||||
if (GET_CONNECTION_STATE(&conn->state) != CONN_QUIT_SENT) {
|
||||
SET_CONNECTION_STATE(&conn->state, CONN_READY);
|
||||
}
|
||||
|
||||
DBG_RETURN(PASS);
|
||||
}
|
||||
/* }}} */
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -56,8 +56,6 @@ require __DIR__ . '/mysql_pdo_test.inc';
|
|||
$db = MySQLPDOTest::factory();
|
||||
$db->exec('DROP PROCEDURE IF EXISTS p');
|
||||
?>
|
||||
--XFAIL--
|
||||
Works with mysqlnd. It is not supported by libmysql. For libmysql is good enough to see no crash.
|
||||
--EXPECT--
|
||||
Emulated...
|
||||
array(1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue