Commit 6acddd53 authored by Sergey Vojtovich's avatar Sergey Vojtovich

global_query_id: my_atomic to Atomic_counter

parent 62687801
...@@ -483,7 +483,7 @@ ulonglong test_flags; ...@@ -483,7 +483,7 @@ ulonglong test_flags;
ulonglong query_cache_size=0; ulonglong query_cache_size=0;
ulong query_cache_limit=0; ulong query_cache_limit=0;
ulong executed_events=0; ulong executed_events=0;
query_id_t global_query_id; Atomic_counter<query_id_t> global_query_id;
ulong aborted_threads, aborted_connects, aborted_connects_preauth; ulong aborted_threads, aborted_connects, aborted_connects_preauth;
ulong delayed_insert_timeout, delayed_insert_limit, delayed_queue_size; ulong delayed_insert_timeout, delayed_insert_limit, delayed_queue_size;
ulong delayed_insert_threads, delayed_insert_writes, delayed_rows_in_use; ulong delayed_insert_threads, delayed_insert_writes, delayed_rows_in_use;
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "sql_bitmap.h" /* Bitmap */ #include "sql_bitmap.h" /* Bitmap */
#include "my_decimal.h" /* my_decimal */ #include "my_decimal.h" /* my_decimal */
#include "mysql_com.h" /* SERVER_VERSION_LENGTH */ #include "mysql_com.h" /* SERVER_VERSION_LENGTH */
#include "my_atomic.h"
#include "my_counter.h" #include "my_counter.h"
#include "mysql/psi/mysql_file.h" /* MYSQL_FILE */ #include "mysql/psi/mysql_file.h" /* MYSQL_FILE */
#include "mysql/psi/mysql_socket.h" /* MYSQL_SOCKET */ #include "mysql/psi/mysql_socket.h" /* MYSQL_SOCKET */
...@@ -763,17 +762,17 @@ enum enum_query_type ...@@ -763,17 +762,17 @@ enum enum_query_type
/* query_id */ /* query_id */
extern query_id_t global_query_id; extern Atomic_counter<query_id_t> global_query_id;
/* increment query_id and return it. */ /* increment query_id and return it. */
inline __attribute__((warn_unused_result)) query_id_t next_query_id() inline __attribute__((warn_unused_result)) query_id_t next_query_id()
{ {
return my_atomic_add64_explicit(&global_query_id, 1, MY_MEMORY_ORDER_RELAXED); return global_query_id++;
} }
inline query_id_t get_query_id() inline query_id_t get_query_id()
{ {
return my_atomic_load64_explicit(&global_query_id, MY_MEMORY_ORDER_RELAXED); return global_query_id;
} }
/* increment global_thread_id and return it. */ /* increment global_thread_id and return it. */
......
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