Commit 00a254cc authored by Aleksey Midenkov's avatar Aleksey Midenkov

MDEV-20186 Wrong result or Assertion on INSERT after DELETE HISTORY

Fix reinitialize vers_write on table reopen.
parent 29df1003
......@@ -118,5 +118,16 @@ with system versioning;
insert into t1 (f) values ('a'), ('b'), ('c'), ('d'), ('e'), ('f'), ('g'), ('h');
delete from t1;
delete history from t1;
drop table t1;
#
# MDEV-20186 Wrong result or Assertion on INSERT after DELETE HISTORY
#
create or replace table t1 (a int check (a > 0)) with system versioning;
delete history from t1;
insert into t1 values (1);
select * from t1;
a
1
drop table t1;
drop database test;
create database test;
......@@ -130,6 +130,16 @@ with system versioning;
insert into t1 (f) values ('a'), ('b'), ('c'), ('d'), ('e'), ('f'), ('g'), ('h');
delete from t1;
delete history from t1;
drop table t1;
--echo #
--echo # MDEV-20186 Wrong result or Assertion on INSERT after DELETE HISTORY
--echo #
create or replace table t1 (a int check (a > 0)) with system versioning;
delete history from t1;
insert into t1 values (1);
select * from t1;
drop table t1;
drop database test;
create database test;
......@@ -4653,6 +4653,7 @@ void TABLE::init(THD *thd, TABLE_LIST *tl)
created= TRUE;
cond_selectivity= 1.0;
cond_selectivity_sampling_explain= NULL;
vers_write= s->versioned;
#ifdef HAVE_REPLICATION
/* used in RBR Triggers */
master_had_triggers= 0;
......
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