mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Tests: versioning.foreign check row_end after constraint execution
This commit is contained in:
parent
052668f500
commit
5fb08323e1
2 changed files with 13 additions and 5 deletions
|
@ -121,6 +121,9 @@ engine innodb;
|
|||
create or replace table child (
|
||||
id int primary key,
|
||||
parent_id int not null,
|
||||
row_start SYS_DATATYPE as row start invisible,
|
||||
row_end SYS_DATATYPE as row end invisible,
|
||||
period for system_time(row_start, row_end),
|
||||
constraint `parent-fk`
|
||||
foreign key (parent_id) references parent (id)
|
||||
on delete cascade
|
||||
|
@ -135,9 +138,9 @@ delete from child;
|
|||
delete from parent;
|
||||
select * from child;
|
||||
id parent_id
|
||||
select * from child for system_time all;
|
||||
id parent_id
|
||||
3 3
|
||||
select *, row_start < row_end, row_end < MAXVAL from child for system_time all;
|
||||
id parent_id row_start < row_end row_end < MAXVAL
|
||||
3 3 1 1
|
||||
drop table child;
|
||||
drop table parent;
|
||||
#################
|
||||
|
|
|
@ -137,9 +137,13 @@ create or replace table parent (
|
|||
)
|
||||
engine innodb;
|
||||
|
||||
create or replace table child (
|
||||
--replace_result $sys_datatype_expl SYS_DATATYPE
|
||||
eval create or replace table child (
|
||||
id int primary key,
|
||||
parent_id int not null,
|
||||
row_start $sys_datatype_expl as row start invisible,
|
||||
row_end $sys_datatype_expl as row end invisible,
|
||||
period for system_time(row_start, row_end),
|
||||
constraint `parent-fk`
|
||||
foreign key (parent_id) references parent (id)
|
||||
on delete cascade
|
||||
|
@ -154,7 +158,8 @@ delete from child;
|
|||
--echo ## FIXME END
|
||||
delete from parent;
|
||||
select * from child;
|
||||
select * from child for system_time all;
|
||||
--replace_result $sys_datatype_max MAXVAL
|
||||
eval select *, row_start < row_end, row_end < $sys_datatype_max from child for system_time all;
|
||||
|
||||
drop table child;
|
||||
drop table parent;
|
||||
|
|
Loading…
Reference in a new issue