Commit 11d27996 authored by Sergei Golubchik's avatar Sergei Golubchik

increment and get the query_id atomically, otherwise two concurrent threads

might end up having the same query id
parent afcd7091
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment