mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
MDEV-25837 Assertion `thd->locked_tables_mode == LTM_NONE' failed in Locked_tables_list::init_locked_tables.
don't do prelocking for the FLUSH command.
This commit is contained in:
parent
0237e9bb65
commit
c2ebe8147d
3 changed files with 26 additions and 1 deletions
|
@ -606,6 +606,17 @@ drop view v1, v2;
|
|||
drop table t1;
|
||||
disconnect con1;
|
||||
#
|
||||
# MDEV-25837 Assertion `thd->locked_tables_mode == LTM_NONE' failed in Locked_tables_list::init_locked_tables.
|
||||
#
|
||||
CREATE FUNCTION f() RETURNS INTEGER RETURN 1;
|
||||
CREATE TABLE t (a INT);
|
||||
CREATE VIEW v AS SELECT 2 FROM t WHERE f() < 3;
|
||||
FLUSH TABLE v WITH READ LOCK;
|
||||
UNLOCK TABLES;
|
||||
DROP VIEW v;
|
||||
DROP FUNCTION f;
|
||||
DROP TABLE t;
|
||||
#
|
||||
# Test FLUSH THREADS
|
||||
#
|
||||
set @save_thread_cache_size=@@global.thread_cache_size;
|
||||
|
|
|
@ -722,6 +722,19 @@ drop view v1, v2;
|
|||
drop table t1;
|
||||
disconnect con1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-25837 Assertion `thd->locked_tables_mode == LTM_NONE' failed in Locked_tables_list::init_locked_tables.
|
||||
--echo #
|
||||
|
||||
CREATE FUNCTION f() RETURNS INTEGER RETURN 1;
|
||||
CREATE TABLE t (a INT);
|
||||
CREATE VIEW v AS SELECT 2 FROM t WHERE f() < 3;
|
||||
FLUSH TABLE v WITH READ LOCK;
|
||||
|
||||
UNLOCK TABLES;
|
||||
DROP VIEW v;
|
||||
DROP FUNCTION f;
|
||||
DROP TABLE t;
|
||||
|
||||
--echo #
|
||||
--echo # Test FLUSH THREADS
|
||||
|
|
|
@ -5553,7 +5553,8 @@ bool lock_tables(THD *thd, TABLE_LIST *tables, uint count, uint flags)
|
|||
DEBUG_SYNC(thd, "after_lock_tables_takes_lock");
|
||||
|
||||
if (thd->lex->requires_prelocking() &&
|
||||
thd->lex->sql_command != SQLCOM_LOCK_TABLES)
|
||||
thd->lex->sql_command != SQLCOM_LOCK_TABLES &&
|
||||
thd->lex->sql_command != SQLCOM_FLUSH)
|
||||
{
|
||||
/*
|
||||
We just have done implicit LOCK TABLES, and now we have
|
||||
|
|
Loading…
Reference in a new issue