mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-14740 Locking assertion for system_time partitioning
Assertion `thd->locked_tables_mode <= LTM_LOCK_TABLES || !thd->lex->requires_prelocking()' failed in lock_tables().
This commit is contained in:
@ -345,5 +345,14 @@ create trigger tr before insert on t2
|
||||
for each row select table_rows from information_schema.tables
|
||||
where table_name = 't1' into @a;
|
||||
insert into t2 values (1);
|
||||
# MDEV-14740 Locking assertion for system_time partitioning
|
||||
create or replace table t1 (i int) with system versioning
|
||||
partition by system_time interval 1 week (
|
||||
partition p1 history,
|
||||
partition pn current);
|
||||
create or replace table t2 (f int);
|
||||
create trigger tr before insert on t2
|
||||
for each row select count(*) from t1 into @a;
|
||||
insert into t2 values (1);
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
@ -293,6 +293,16 @@ for each row select table_rows from information_schema.tables
|
||||
where table_name = 't1' into @a;
|
||||
insert into t2 values (1);
|
||||
|
||||
--echo # MDEV-14740 Locking assertion for system_time partitioning
|
||||
create or replace table t1 (i int) with system versioning
|
||||
partition by system_time interval 1 week (
|
||||
partition p1 history,
|
||||
partition pn current);
|
||||
create or replace table t2 (f int);
|
||||
create trigger tr before insert on t2
|
||||
for each row select count(*) from t1 into @a;
|
||||
insert into t2 values (1);
|
||||
|
||||
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
@ -1035,18 +1035,20 @@ class Table_locker
|
||||
{
|
||||
THD *thd;
|
||||
TABLE &table;
|
||||
thr_lock_type saved_mode;
|
||||
TABLE_LIST table_list;
|
||||
thr_lock_type saved_type;
|
||||
MYSQL_LOCK *saved_lock;
|
||||
enum_locked_tables_mode saved_mode;
|
||||
TABLE_LIST table_list;
|
||||
bool locked;
|
||||
|
||||
public:
|
||||
Table_locker(THD *_thd, TABLE &_table, thr_lock_type lock_type) :
|
||||
thd(_thd),
|
||||
table(_table),
|
||||
saved_mode(table.reginfo.lock_type),
|
||||
table_list(_table, lock_type),
|
||||
saved_type(table.reginfo.lock_type),
|
||||
saved_lock(_thd->lock),
|
||||
saved_mode(_thd->locked_tables_mode),
|
||||
table_list(_table, lock_type),
|
||||
locked(false)
|
||||
{
|
||||
table.reginfo.lock_type= lock_type;
|
||||
@ -1066,8 +1068,9 @@ public:
|
||||
{
|
||||
if (locked)
|
||||
mysql_unlock_tables(thd, thd->lock);
|
||||
table.reginfo.lock_type= saved_mode;
|
||||
table.reginfo.lock_type= saved_type;
|
||||
thd->lock= saved_lock;
|
||||
thd->locked_tables_mode= saved_mode;
|
||||
if (locked && !thd->in_sub_stmt)
|
||||
ha_commit_trans(thd, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user