diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2020-05-24 17:13:12 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2020-05-25 14:54:11 +0200 |
commit | 9aa6042a0de639e5401e95d0305bfb841f374c3c (patch) | |
tree | a3ab49a45a023e60c8feb0619fc5fd7920d343e5 /sql/threadpool_common.cc | |
parent | 17437eb2597fb9138f0c8ca6a7a4870e9afc937c (diff) | |
download | mariadb-git-9aa6042a0de639e5401e95d0305bfb841f374c3c.tar.gz |
MDEV-22696 Threadpool : make sure thd->event_scheduler.data does not change as long as THD is in server_threads.
Diffstat (limited to 'sql/threadpool_common.cc')
-rw-r--r-- | sql/threadpool_common.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc index 83a599a01dd..ada957eec10 100644 --- a/sql/threadpool_common.cc +++ b/sql/threadpool_common.cc @@ -211,12 +211,11 @@ void tp_callback(TP_connection *c) error: c->thd= 0; - delete c; - if (thd) { threadpool_remove_connection(thd); } + delete c; worker_context.restore(); } @@ -243,9 +242,11 @@ static THD* threadpool_add_connection(CONNECT *connect, void *scheduler_data) return NULL; } delete connect; + + thd->event_scheduler.data = scheduler_data; server_threads.insert(thd); thd->set_mysys_var(mysys_var); - thd->event_scheduler.data= scheduler_data; + /* Login. */ thread_attach(thd); @@ -280,7 +281,6 @@ end: static void threadpool_remove_connection(THD *thd) { thread_attach(thd); - thd->event_scheduler.data= 0; thd->net.reading_or_writing = 0; end_connection(thd); close_connection(thd, 0); |