Commit f2433b8d authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-10824 - Crash in CREATE OR REPLACE TABLE t1 AS SELECT spfunc()

followup for a3c980b3

same change in Locked_tables_list::unlink_from_list(), otherwise
thd->locked_tables_list will keep pointers to a free'd TABLE if
prelocked under lock tables.

This fixes a crash in main.create_or_replace on debug Win builds
after bcb36ee2
parent 9fffa937
......@@ -2872,7 +2872,8 @@ void Locked_tables_list::unlink_from_list(THD *thd,
If mode is not LTM_LOCK_TABLES, we needn't do anything. Moreover,
outside this mode pos_in_locked_tables value is not trustworthy.
*/
if (thd->locked_tables_mode != LTM_LOCK_TABLES)
if (thd->locked_tables_mode != LTM_LOCK_TABLES &&
thd->locked_tables_mode != LTM_PRELOCKED_UNDER_LOCK_TABLES)
return;
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment