1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

increment and get the query_id atomically, otherwise two concurrent threads

might end up having the same query id
This commit is contained in:
Sergei Golubchik
2014-02-19 21:40:15 +01:00
parent afcd7091a0
commit 11d27996e4

View File

@ -917,9 +917,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
DEBUG_SYNC(thd,"dispatch_command_before_set_time");
thd->set_time();
thd->set_query_id(get_query_id());
if (!(server_command_flags[command] & CF_SKIP_QUERY_ID))
next_query_id();
if (server_command_flags[command] & CF_SKIP_QUERY_ID)
thd->set_query_id(get_query_id());
else
thd->set_query_id(next_query_id());
inc_thread_running();
if (!(server_command_flags[command] & CF_SKIP_QUESTIONS))