mariadb/mysql-test/suite/versioning/t/create.test

207 lines
5.4 KiB
Text

-- source include/have_innodb.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (
XNo int unsigned,
Sys_start timestamp(6) generated always as row start,
Sys_end timestamp(6) generated always as row end,
period for system_time (Sys_start, Sys_end)
) with system versioning;
show create table t1;
--echo # Implicit fields test
create or replace table t1 (
XNo int unsigned
) with system versioning;
show create table t1;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
XNo int unsigned,
Sys_start timestamp(6) generated always as row start,
Sys_start2 timestamp(6) generated always as row start,
Sys_end timestamp(6) generated always as row end,
period for system_time (Sys_start, Sys_end)
) with system versioning;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
XNo int unsigned,
Sys_start timestamp(6) generated always as row start,
Sys_end2 timestamp(6) generated always as row end,
period for system_time (Sys_start, Sys_end)
) with system versioning;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
XNo int unsigned,
Sys_start timestamp(6) generated always as row start,
Sys_end timestamp(6) generated always as row end,
Sys_end2 timestamp(6) generated always as row end,
period for system_time (Sys_start, Sys_end)
) with system versioning;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
XNo int unsigned,
period for system_time (Sys_start, Sys_end)
) with system versioning;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
XNo int unsigned,
Sys_start timestamp(6) generated always as row start,
Sys_end timestamp(6) generated always as row end,
Sys_end2 timestamp(6) generated always as row end,
period for system_time (Sys_start, Sys_end)
);
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
XNo int unsigned,
Sys_start timestamp(6) generated always as row start,
Sys_end timestamp(6) generated always as row end,
period for system_time (sys_insert, sys_remove)
) with system versioning;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
XNo int unsigned,
Sys_start timestamp(6) generated always as row start,
Sys_end timestamp(6) generated always as row end,
period for system_time (Sys_start, Sys_end)
);
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
XNo int unsigned,
Sys_start timestamp(6) generated always as row start,
Sys_end timestamp(6) generated always as row end,
period for system_time (Sys_start, Sys_start)
);
--error ER_VERS_FIELD_WRONG_TYPE
create or replace table t1 (
XNo int unsigned,
Sys_start int generated always as row start,
Sys_end timestamp(6) generated always as row end,
period for system_time (Sys_start, Sys_end)
) with system versioning;
--error ER_VERS_FIELD_WRONG_TYPE
create or replace table t1 (
XNo int unsigned,
Sys_start timestamp(6) generated always as row start,
Sys_end int generated always as row end,
period for system_time (Sys_start, Sys_end)
) with system versioning;
--error ER_VERS_FIELD_WRONG_TYPE
create or replace table t1 (
XNo int unsigned,
Sys_start timestamp(6) generated always as row start,
Sys_end bigint generated always as row end,
period for system_time (Sys_start, Sys_end)
) with system versioning engine innodb;
--error ER_VERS_FIELD_WRONG_TYPE
create or replace table t1 (
XNo int unsigned,
Sys_start bigint generated always as row start,
Sys_end bigint generated always as row end,
period for system_time (Sys_start, Sys_end)
) with system versioning engine innodb;
--error ER_VERS_FIELD_WRONG_TYPE
create or replace table t1 (
XNo int unsigned,
Sys_start bigint unsigned generated always as row start,
Sys_end bigint generated always as row end,
period for system_time (Sys_start, Sys_end)
) with system versioning engine innodb;
create or replace table t1 (
A int with system versioning,
B int
);
show create table t1;
create or replace table t1 (
A int with system versioning,
B int
) with system versioning;
show create table t1;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
A int,
B int without system versioning
);
create or replace table t1 (
A int,
B int without system versioning
) with system versioning;
show create table t1;
create or replace table t1 (
A int with system versioning,
B int without system versioning
);
show create table t1;
create or replace table t1 (
A int with system versioning,
B int without system versioning
) with system versioning;
show create table t1;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
A int without system versioning
);
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
A int without system versioning
) with system versioning;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
A int without system versioning with system versioning
);
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
A int with system versioning without system versioning
);
--error ER_VERS_WRONG_PARAMS
create table t(
a int
) without system versioning;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
A int
) without system versioning with system versioning;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
A int
) with system versioning without system versioning;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
A int
) with system versioning with system versioning;
--error ER_VERS_WRONG_PARAMS
create or replace table t1 (
A int
) without system versioning without system versioning;
drop table t1;