mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +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:
@ -917,9 +917,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||||||
DEBUG_SYNC(thd,"dispatch_command_before_set_time");
|
DEBUG_SYNC(thd,"dispatch_command_before_set_time");
|
||||||
|
|
||||||
thd->set_time();
|
thd->set_time();
|
||||||
|
if (server_command_flags[command] & CF_SKIP_QUERY_ID)
|
||||||
thd->set_query_id(get_query_id());
|
thd->set_query_id(get_query_id());
|
||||||
if (!(server_command_flags[command] & CF_SKIP_QUERY_ID))
|
else
|
||||||
next_query_id();
|
thd->set_query_id(next_query_id());
|
||||||
inc_thread_running();
|
inc_thread_running();
|
||||||
|
|
||||||
if (!(server_command_flags[command] & CF_SKIP_QUESTIONS))
|
if (!(server_command_flags[command] & CF_SKIP_QUESTIONS))
|
||||||
|
Reference in New Issue
Block a user