From d27327a003e2a97113b0c69a246dc9355efa9176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sun, 10 Dec 2017 13:51:14 +0100 Subject: [PATCH] Generate different stmt_id if clients ask for the same multiple times --- lib/MySQL_PreparedStatement.cpp | 2 ++ lib/MySQL_Session.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/MySQL_PreparedStatement.cpp b/lib/MySQL_PreparedStatement.cpp index 4a6d06f6b..702d484ea 100644 --- a/lib/MySQL_PreparedStatement.cpp +++ b/lib/MySQL_PreparedStatement.cpp @@ -939,6 +939,7 @@ MySQL_STMT_Global_info *MySQL_STMT_Manager_v14::find_prepared_statement_by_stmt_ uint32_t MySQL_STMTs_local_v14::generate_new_client_stmt_id(uint64_t global_statement_id) { uint32_t ret=0; +/* //auto s2 = global_stmt_to_client_ids.find(global_statement_id); std::pair::iterator, std::multimap::iterator> itret; itret = global_stmt_to_client_ids.equal_range(global_statement_id); @@ -946,6 +947,7 @@ uint32_t MySQL_STMTs_local_v14::generate_new_client_stmt_id(uint64_t global_stat ret = it->second; return ret; } +*/ if (free_client_ids.size()) { ret=free_client_ids.top(); free_client_ids.pop(); diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index bd541432d..0302dab7c 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -2680,6 +2680,7 @@ handler_again: #else global_stmtid=stmt_info->statement_id; myds->myconn->local_stmts->backend_insert(global_stmtid,CurrentQuery.mysql_stmt); + if (previous_status.size() == 0) client_stmtid=client_myds->myconn->local_stmts->generate_new_client_stmt_id(global_stmtid); #endif CurrentQuery.mysql_stmt=NULL;