diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-08-18 16:51:52 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-08-18 16:51:52 +0300 |
commit | f84e28c119b495da77e197f7cd18af4048fc3126 (patch) | |
tree | 5957008a7725e23cc6331b1251ff5d3f6b725076 /mysql-test/suite/versioning | |
parent | ac2857a5fbf851d90171ac55f23385869ee6ba83 (diff) | |
parent | e4901d9523ab838ea13bb0278980f8707aa2c581 (diff) | |
download | mariadb-git-f84e28c119b495da77e197f7cd18af4048fc3126.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/suite/versioning')
-rw-r--r-- | mysql-test/suite/versioning/r/foreign.result | 13 | ||||
-rw-r--r-- | mysql-test/suite/versioning/t/foreign.test | 18 |
2 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/suite/versioning/r/foreign.result b/mysql-test/suite/versioning/r/foreign.result index 288909bbc37..2dbceebb539 100644 --- a/mysql-test/suite/versioning/r/foreign.result +++ b/mysql-test/suite/versioning/r/foreign.result @@ -445,3 +445,16 @@ pk f1 f2 left(f3, 4) check_row_ts(row_start, row_end) 1 8 8 SHOR HISTORICAL ROW 2 8 8 LONG HISTORICAL ROW drop table t1; +# +# MDEV-21555 Assertion secondary index is out of sync on delete from versioned table +# +create table t1 (a int, b int as (a + 1) virtual, key(a)) engine=innodb with system versioning; +set foreign_key_checks= off; +insert into t1 (a) values (1), (2); +alter table t1 add foreign key (b) references t1 (a), algorithm=copy; +update t1 set a= null where a = 1; +delete from t1 where a is null; +set foreign_key_checks= on; +delete history from t1; +delete from t1; +drop table t1; diff --git a/mysql-test/suite/versioning/t/foreign.test b/mysql-test/suite/versioning/t/foreign.test index 4143cd59048..20c35028565 100644 --- a/mysql-test/suite/versioning/t/foreign.test +++ b/mysql-test/suite/versioning/t/foreign.test @@ -476,4 +476,22 @@ select pk, f1, f2, left(f3, 4), check_row_ts(row_start, row_end) from t1 for sys # cleanup drop table t1; +--echo # +--echo # MDEV-21555 Assertion secondary index is out of sync on delete from versioned table +--echo # +create table t1 (a int, b int as (a + 1) virtual, key(a)) engine=innodb with system versioning; + +set foreign_key_checks= off; +insert into t1 (a) values (1), (2); +alter table t1 add foreign key (b) references t1 (a), algorithm=copy; +update t1 set a= null where a = 1; +delete from t1 where a is null; +set foreign_key_checks= on; + +delete history from t1; +delete from t1; + +# cleanup +drop table t1; + --source suite/versioning/common_finish.inc |