Skip to content
Permalink
Browse files
MDEV-10824 - Crash in CREATE OR REPLACE TABLE t1 AS SELECT spfunc()
followup for a3c980b

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 bcb36ee
  • Loading branch information
vuvova committed Apr 21, 2018
1 parent 9fffa93 commit f2433b8
Showing 1 changed file with 2 additions and 1 deletion.
@@ -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;

/*

0 comments on commit f2433b8

Please sign in to comment.