Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves #3371 Error handling if statement global id not found #3808

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/MySQL_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3135,10 +3135,14 @@ void MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
memcpy(&client_stmt_id,(char *)pkt.ptr+5,sizeof(uint32_t));
stmt_global_id=client_myds->myconn->local_stmts->find_global_stmt_id_from_client(client_stmt_id);
if (stmt_global_id == 0) {
// FIXME: add error handling
// LCOV_EXCL_START
assert(0);
// LCOV_EXCL_STOP
proxy_error("Could not execute statement, global id not found. Client statement id is %d. Client will be disconnected.", client_stmt_id);
l_free(pkt.size,pkt.ptr);
client_myds->setDSS_STATE_QUERY_SENT_NET();
client_myds->myprot.generate_pkt_ERR(true, nullptr, nullptr, 1, 1243, (char*)"28000", (char*)"Prepared statement not found", true);
client_myds->DSS=STATE_SLEEP;
status=WAITING_CLIENT_DATA;
client_myds->destroy_MySQL_Connection_From_Pool(true);
return;
}
CurrentQuery.stmt_global_id=stmt_global_id;
// now we get the statement information
Expand Down