1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge branch '10.4' into 10.5

This commit is contained in:
Oleksandr Byelkin
2022-02-01 20:33:04 +01:00
460 changed files with 9909 additions and 2408 deletions

View File

@ -2502,6 +2502,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
@ -3162,6 +3167,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;
@ -3280,6 +3287,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.