Skip to content

Commit 57f827c

Browse files
committed
MDEV-14741 Assertion '(trx)->start_file == 0' failed
in row_truncate_table_for_mysql()
1 parent 7f1777a commit 57f827c

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

mysql-test/suite/versioning/r/partition.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,5 +354,13 @@ create or replace table t2 (f int);
354354
create trigger tr before insert on t2
355355
for each row select count(*) from t1 into @a;
356356
insert into t2 values (1);
357+
# MDEV-14741 Assertion `(trx)->start_file == 0' failed in row_truncate_table_for_mysql()
358+
create or replace table t1 (i int) with system versioning
359+
partition by system_time interval 1 hour (
360+
partition p1 history,
361+
partition pn current);
362+
set autocommit= off;
363+
truncate table t1;
364+
set autocommit= on;
357365
drop table t1;
358366
drop table t2;

mysql-test/suite/versioning/t/partition.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,14 @@ create trigger tr before insert on t2
303303
for each row select count(*) from t1 into @a;
304304
insert into t2 values (1);
305305

306+
--echo # MDEV-14741 Assertion `(trx)->start_file == 0' failed in row_truncate_table_for_mysql()
307+
create or replace table t1 (i int) with system versioning
308+
partition by system_time interval 1 hour (
309+
partition p1 history,
310+
partition pn current);
311+
set autocommit= off;
312+
truncate table t1;
313+
set autocommit= on;
306314

307315
drop table t1;
308316
drop table t2;

sql/partition_info.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,10 @@ class Table_locker
10721072
thd->lock= saved_lock;
10731073
thd->locked_tables_mode= saved_mode;
10741074
if (locked && !thd->in_sub_stmt)
1075+
{
10751076
ha_commit_trans(thd, false);
1077+
ha_commit_trans(thd, true);
1078+
}
10761079
}
10771080
};
10781081

0 commit comments

Comments
 (0)