diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2021-11-02 04:52:04 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2021-11-02 11:49:47 +0300 |
commit | c8cece91440edb77aa43b8ba20930fa91514308e (patch) | |
tree | ed9f937459998955cd1a1784392464fa124e6f4c /mysql-test/suite | |
parent | 1be39f86ccced289f7a1755467f801a1b5974ede (diff) | |
download | mariadb-git-c8cece91440edb77aa43b8ba20930fa91514308e.tar.gz |
MDEV-26928 Column-inclusive WITH SYSTEM VERSIONING doesn't work with explicit system fields
versioning_fields flag indicates that any columns were specified WITH
SYSTEM VERSIONING. In that case we imply WITH SYSTEM VERSIONING for
the whole table and WITHOUT SYSTEM VERSIONING for the other columns.
Diffstat (limited to 'mysql-test/suite')
-rw-r--r-- | mysql-test/suite/versioning/r/create.result | 25 | ||||
-rw-r--r-- | mysql-test/suite/versioning/t/create.test | 17 |
2 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/suite/versioning/r/create.result b/mysql-test/suite/versioning/r/create.result index fe0e6c807c3..8943ea1f1cd 100644 --- a/mysql-test/suite/versioning/r/create.result +++ b/mysql-test/suite/versioning/r/create.result @@ -599,3 +599,28 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`id`) ) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING drop table t1; +# +# MDEV-26928 Column-inclusive WITH SYSTEM VERSIONING doesn't work with explicit system fields +# +create or replace table t1 (x int, y int with system versioning); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING, + `y` int(11) DEFAULT NULL +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING +create or replace table t1 ( +x int, y int with system versioning, +row_start timestamp(6) as row start, +row_end timestamp(6) as row end, +period for system_time(row_start, row_end)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING, + `y` int(11) DEFAULT NULL, + `row_start` timestamp(6) GENERATED ALWAYS AS ROW START WITHOUT SYSTEM VERSIONING, + `row_end` timestamp(6) GENERATED ALWAYS AS ROW END WITHOUT SYSTEM VERSIONING, + PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`) +) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING +drop table t1; diff --git a/mysql-test/suite/versioning/t/create.test b/mysql-test/suite/versioning/t/create.test index 1d9f3a1b341..b1f0055f5cc 100644 --- a/mysql-test/suite/versioning/t/create.test +++ b/mysql-test/suite/versioning/t/create.test @@ -451,3 +451,20 @@ show index from t1; --replace_result $default_engine DEFAULT_ENGINE show create table t1; drop table t1; + +--echo # +--echo # MDEV-26928 Column-inclusive WITH SYSTEM VERSIONING doesn't work with explicit system fields +--echo # +create or replace table t1 (x int, y int with system versioning); +--replace_result $default_engine DEFAULT_ENGINE +show create table t1; + +create or replace table t1 ( + x int, y int with system versioning, + row_start timestamp(6) as row start, + row_end timestamp(6) as row end, + period for system_time(row_start, row_end)); +--replace_result $default_engine DEFAULT_ENGINE +show create table t1; + +drop table t1; |