1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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.
This commit is contained in:
Aleksey Midenkov
2021-11-02 04:52:04 +03:00
parent 1be39f86cc
commit c8cece9144
3 changed files with 47 additions and 5 deletions

View File

@ -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;

View File

@ -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;