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

MDEV-26583 SIGSEGV's in spider_get_select_limit_from_select_lex when DELAYED INSERT is used

Spider dereferences a freed select_lex and then results in SIGSEGV.
This commit is contained in:
Nayuta Yanagisawa
2022-01-04 13:21:14 +09:00
parent e128d852e8
commit f8c3d59274
4 changed files with 86 additions and 0 deletions

View File

@ -2423,6 +2423,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