1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge branch '10.6' into 10.7

This commit is contained in:
Oleksandr Byelkin
2022-02-04 14:11:46 +01:00
910 changed files with 20135 additions and 6204 deletions

View File

@ -2524,6 +2524,11 @@ bool delayed_get_table(THD *thd, MDL_request *grl_protection_request,
di->table_list.alias.str= di->table_list.table_name.str= di->thd.query();
di->table_list.alias.length= di->table_list.table_name.length= di->thd.query_length();
di->table_list.db= di->thd.db;
/*
Nulify select_lex because, if the thread that spawned the current one
disconnects, the select_lex will point to freed memory.
*/
di->table_list.select_lex= NULL;
/*
We need the tickets so that they can be cloned in
handle_delayed_insert
@ -3183,6 +3188,8 @@ pthread_handler_t handle_delayed_insert(void *arg)
di->handler_thread_initialized= TRUE;
di->table_list.mdl_request.ticket= NULL;
thd->set_query_id(next_query_id());
if (di->open_and_lock_table())
goto err;
@ -3301,6 +3308,7 @@ pthread_handler_t handle_delayed_insert(void *arg)
if (di->tables_in_use && ! thd->lock &&
(!thd->killed || di->stacked_inserts))
{
thd->set_query_id(next_query_id());
/*
Request for new delayed insert.
Lock the table, but avoid to be blocked by a global read lock.