Prevent mysqli::next_result from reporting errors from previous calls (#7304)

This commit is contained in:
Kamil Tekiela 2021-07-27 11:50:28 +01:00 committed by GitHub
parent 1fa26eccba
commit d26069a2f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 5 deletions

View file

@ -1481,13 +1481,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn)
DBG_ENTER("mysqlnd_conn_data::next_result");
DBG_INF_FMT("conn=%llu", conn->thread_id);
SET_EMPTY_ERROR(conn->error_info);
if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
if (GET_CONNECTION_STATE(&conn->state) != CONN_NEXT_RESULT_PENDING) {
break;
}
SET_EMPTY_ERROR(conn->error_info);
UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status);
/*
We are sure that there is a result set, since conn->state is set accordingly