Commit 11c68827 authored by Aleksey Midenkov's avatar Aleksey Midenkov

MDEV-14747 ALTER PARTITION BY SYSTEM_TIME after LOCK TABLES

parent 4236f589
......@@ -366,5 +366,11 @@ partition pn current);
set autocommit= off;
truncate table t1;
set autocommit= on;
MDEV-14747 ALTER PARTITION BY SYSTEM_TIME after LOCK TABLES
create or replace table t1 (x int) with system versioning;
lock table t1 write;
alter table t1 partition by system_time interval 1 week (
partition p1 history,
partition pn current);
drop table t1;
drop table t2;
......@@ -314,6 +314,13 @@ set autocommit= off;
truncate table t1;
set autocommit= on;
--echo MDEV-14747 ALTER PARTITION BY SYSTEM_TIME after LOCK TABLES
create or replace table t1 (x int) with system versioning;
lock table t1 write;
alter table t1 partition by system_time interval 1 week (
partition p1 history,
partition pn current);
drop table t1;
drop table t2;
......
......@@ -1057,9 +1057,13 @@ class Table_locker
{
DBUG_ASSERT(table.file);
// FIXME: check consistency with table.reginfo.lock_type
if (table.file->get_lock_type() != F_UNLCK)
if (table.file->get_lock_type() != F_UNLCK
|| table.s->tmp_table)
{
return false;
}
thd->lock= NULL;
thd->locked_tables_mode= LTM_NONE;
bool res= lock_tables(thd, &table_list, 1, 0);
locked= !res;
return res;
......
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