MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
GNU General Public License v2.0
0
stars
0
forks
source link
MDEV-20812 Unexpected ER_ROW_IS_REFERENCED_2 or server crash in row_ins_foreign_report_err upon DELETE from versioned table with FK #62
--source include/have_innodb.inc
set foreign_key_checks= 0;
create or replace table t2 (b int, foreign key (b) references t1(a)) engine=innodb with system versioning;
insert into t2 values (1),(1);
set foreign_key_checks= 1;
delete from t2;
# cleanup
drop table t2;
Expected
DELETE doesn't fail.
Reproduce 2 (crash)
create or replace table t1 (a int);
create or replace table t2 (s date, e date, period for app(s,e), key(s));
replace into t1 values (1), (2);
replace into t2 values ('2018-01-02','2027-06-22'),('2019-12-12','2020-12-12');
create view v as select * from t1 join t2;
update v set e = '2021-01-01' order by s limit 1;
# cleanup
drop view v;
drop table t1, t2;
Reproduce
Expected
DELETE doesn't fail.
Reproduce 2 (crash)