diff options
Diffstat (limited to 'mysql-test/suite/versioning/r/foreign.result')
-rw-r--r-- | mysql-test/suite/versioning/r/foreign.result | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/suite/versioning/r/foreign.result b/mysql-test/suite/versioning/r/foreign.result index 1b9925b1e62..5234a1ad616 100644 --- a/mysql-test/suite/versioning/r/foreign.result +++ b/mysql-test/suite/versioning/r/foreign.result @@ -429,3 +429,41 @@ insert into t2 values (1), (1); # DELETE from foreign table is allowed delete from t2; drop tables t2, t1; +# +# MDEV-20729 Fix REFERENCES constraint in column definition +# +create or replace table t1( +id int +); +# system fields can't be foreign keys: +create or replace table t2( +x int, +sys_start SYS_DATATYPE as row start references t1(id), +sys_end SYS_DATATYPE as row end, +period for system_time(sys_start, sys_end) +) engine innodb with system versioning; +Got one of the listed errors +create or replace table t2( +x int, +sys_start SYS_DATATYPE as row start, +sys_end SYS_DATATYPE as row end references t1(id), +period for system_time(sys_start, sys_end) +) engine innodb with system versioning; +Got one of the listed errors +create or replace table t2( +x int, +sys_start SYS_DATATYPE as row start, +sys_end SYS_DATATYPE as row end, +period for system_time(sys_start, sys_end), +foreign key (sys_start) references t1(id) +) engine innodb with system versioning; +ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") +create or replace table t2( +x int, +sys_start SYS_DATATYPE as row start, +sys_end SYS_DATATYPE as row end, +period for system_time(sys_start, sys_end), +foreign key (sys_end) references t1(id) +) engine innodb with system versioning; +ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") +drop table t1; |