summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2020-04-30 20:06:26 +0300
committerEugene Kosov <claprix@yandex.ru>2020-05-05 18:13:31 +0300
commit89ff4176c125f5993aba0732e52102227577ed96 (patch)
tree42980e30d3f4f02b09b0fda80790f7241fd699f4 /sql/sql_insert.cc
parent90aad47dd9f28101b1d2c4a01c2a10db5ad5f426 (diff)
downloadmariadb-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_insert.cc')
-rw-r--r--sql/sql_insert.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 2a2b74405f3..0914b4ac497 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -3087,15 +3087,16 @@ pthread_handler_t handle_delayed_insert(void *arg)
{
DBUG_ENTER("handle_delayed_insert");
thd->thread_stack= (char*) &thd;
- if (init_thr_lock() || thd->store_globals())
+ if (init_thr_lock())
{
- /* Can't use my_error since store_globals has perhaps failed */
thd->get_stmt_da()->set_error_status(ER_OUT_OF_RESOURCES);
di->handler_thread_initialized= TRUE;
thd->fatal_error();
goto err;
}
+ thd->store_globals();
+
thd->lex->sql_command= SQLCOM_INSERT; // For innodb::store_lock()
/*