diff options
author | Eugene Kosov <claprix@yandex.ru> | 2020-04-30 20:06:26 +0300 |
---|---|---|
committer | Eugene Kosov <claprix@yandex.ru> | 2020-05-05 18:13:31 +0300 |
commit | 89ff4176c125f5993aba0732e52102227577ed96 (patch) | |
tree | 42980e30d3f4f02b09b0fda80790f7241fd699f4 /sql/sql_connect.cc | |
parent | 90aad47dd9f28101b1d2c4a01c2a10db5ad5f426 (diff) | |
download | mariadb-git-89ff4176c125f5993aba0732e52102227577ed96.tar.gz |
MDEV-22437 make THR_THD* variable thread_local
Now all access goes through _current_thd() and set_current_thd()
functions.
Some functions like THD::store_globals() can not fail now.
Diffstat (limited to 'sql/sql_connect.cc')
-rw-r--r-- | sql/sql_connect.cc | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index aa9e561a717..dbe66650476 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -1105,16 +1105,9 @@ static int check_connection(THD *thd) In this case we will close the connection and increment status */ -bool setup_connection_thread_globals(THD *thd) +void setup_connection_thread_globals(THD *thd) { - if (thd->store_globals()) - { - close_connection(thd, ER_OUT_OF_RESOURCES); - statistic_increment(aborted_connects,&LOCK_status); - statistic_increment(connection_errors_internal, &LOCK_status); - return 1; // Error - } - return 0; + thd->store_globals(); } @@ -1397,12 +1390,7 @@ void do_handle_one_connection(CONNECT *connect, bool put_in_cache) stack overruns. */ thd->thread_stack= (char*) &thd; - if (setup_connection_thread_globals(thd)) - { - unlink_thd(thd); - delete thd; - return; - } + setup_connection_thread_globals(thd); for (;;) { |