mirror of https://github.com/sysown/proxysql
If 'mysql_stmt_store_result' fails with an error, it currently fails to update the internal state machine for 'stmt', announcing that the fetch operation has completed.pull/4016/head
parent
a5574233a1
commit
68f9c63cea
@ -0,0 +1,14 @@
|
||||
diff --git libmariadb/mariadb_stmt.c libmariadb/mariadb_stmt.c
|
||||
index ba1617b..1c8d2e6 100644
|
||||
--- libmariadb/mariadb_stmt.c
|
||||
+++ libmariadb/mariadb_stmt.c
|
||||
@@ -1838,6 +1838,9 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
|
||||
stmt->result.data= NULL;
|
||||
stmt->result.rows= 0;
|
||||
stmt->mysql->status= MYSQL_STATUS_READY;
|
||||
+ /* In case of error, stmt internal state needs to be reset. Otherwise state machine could be left in an
|
||||
+ inconsistent state and further calls to 'mysql_stmt_execute' will halt. */
|
||||
+ stmt->state= MYSQL_STMT_FETCH_DONE;
|
||||
return(1);
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue