mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
227 lines
9.1 KiB
Plaintext
227 lines
9.1 KiB
Plaintext
drop table if exists t1;
|
|
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;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`XNo` int(10) unsigned DEFAULT NULL,
|
|
`Sys_start` timestamp(6) NOT NULL GENERATED ALWAYS AS ROW START,
|
|
`Sys_end` timestamp(6) NOT NULL GENERATED ALWAYS AS ROW END,
|
|
PERIOD FOR SYSTEM_TIME (`Sys_start`, `Sys_end`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
|
# Implicit fields test
|
|
create or replace table t1 (
|
|
XNo int unsigned
|
|
) with system versioning;
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`XNo` int(10) unsigned DEFAULT NULL,
|
|
`sys_trx_start` timestamp(6) GENERATED ALWAYS AS ROW START,
|
|
`sys_trx_end` timestamp(6) GENERATED ALWAYS AS ROW END,
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
|
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 HY000: Wrong parameters for versioned table `t1`: multiple 'GENERATED ALWAYS AS ROW START'
|
|
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 HY000: Wrong parameters for versioned table `t1`: 'PERIOD FOR SYSTEM_TIME' and 'GENERATED AS ROW END' mismatch
|
|
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 HY000: Wrong parameters for versioned table `t1`: multiple 'GENERATED ALWAYS AS ROW END'
|
|
create or replace table t1 (
|
|
XNo int unsigned,
|
|
period for system_time (Sys_start, Sys_end)
|
|
) with system versioning;
|
|
ERROR HY000: Wrong parameters for versioned table `t1`: 'GENERATED AS ROW START' column missing
|
|
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 HY000: Wrong parameters for versioned table `t1`: multiple 'GENERATED ALWAYS AS ROW END'
|
|
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 HY000: Wrong parameters for versioned table `t1`: 'PERIOD FOR SYSTEM_TIME' and 'GENERATED AS ROW START' mismatch
|
|
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 HY000: Wrong parameters for versioned table `t1`: 'WITH SYSTEM VERSIONING' missing
|
|
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 HY000: Wrong parameters for versioned table `t1`: 'PERIOD FOR SYSTEM_TIME' columns must be different
|
|
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 HY000: `Sys_start` must be of type `TIMESTAMP(6)` for versioned table `t1`
|
|
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 HY000: `Sys_end` must be of type `TIMESTAMP(6)` for versioned table `t1`
|
|
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 HY000: `Sys_start` must be of type `BIGINT(20) UNSIGNED` for versioned table `t1`
|
|
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 HY000: `Sys_start` must be of type `BIGINT(20) UNSIGNED` for versioned table `t1`
|
|
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;
|
|
ERROR HY000: `Sys_end` must be of type `BIGINT(20) UNSIGNED` for versioned table `t1`
|
|
create or replace table t1 (
|
|
A int with system versioning,
|
|
B int
|
|
);
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`A` int(11) DEFAULT NULL,
|
|
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
|
|
`sys_trx_start` timestamp(6) GENERATED ALWAYS AS ROW START,
|
|
`sys_trx_end` timestamp(6) GENERATED ALWAYS AS ROW END,
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
|
create or replace table t1 (
|
|
A int with system versioning,
|
|
B int
|
|
) with system versioning;
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`A` int(11) DEFAULT NULL,
|
|
`B` int(11) DEFAULT NULL,
|
|
`sys_trx_start` timestamp(6) GENERATED ALWAYS AS ROW START,
|
|
`sys_trx_end` timestamp(6) GENERATED ALWAYS AS ROW END,
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
|
create or replace table t1 (
|
|
A int,
|
|
B int without system versioning
|
|
);
|
|
ERROR HY000: Wrong parameters for versioned table `t1`: 'WITH SYSTEM VERSIONING' missing
|
|
create or replace table t1 (
|
|
A int,
|
|
B int without system versioning
|
|
) with system versioning;
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`A` int(11) DEFAULT NULL,
|
|
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
|
|
`sys_trx_start` timestamp(6) GENERATED ALWAYS AS ROW START,
|
|
`sys_trx_end` timestamp(6) GENERATED ALWAYS AS ROW END,
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
|
create or replace table t1 (
|
|
A int with system versioning,
|
|
B int without system versioning
|
|
);
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`A` int(11) DEFAULT NULL,
|
|
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
|
|
`sys_trx_start` timestamp(6) GENERATED ALWAYS AS ROW START,
|
|
`sys_trx_end` timestamp(6) GENERATED ALWAYS AS ROW END,
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
|
create or replace table t1 (
|
|
A int with system versioning,
|
|
B int without system versioning
|
|
) with system versioning;
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`A` int(11) DEFAULT NULL,
|
|
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
|
|
`sys_trx_start` timestamp(6) GENERATED ALWAYS AS ROW START,
|
|
`sys_trx_end` timestamp(6) GENERATED ALWAYS AS ROW END,
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
|
create or replace table t1 (
|
|
A int without system versioning
|
|
);
|
|
ERROR HY000: Wrong parameters for versioned table `t1`: 'WITH SYSTEM VERSIONING' missing
|
|
create or replace table t1 (
|
|
A int without system versioning
|
|
) with system versioning;
|
|
ERROR HY000: Wrong parameters for versioned table `t1`: versioned fields missing
|
|
create or replace table t1 (
|
|
A int without system versioning with system versioning
|
|
);
|
|
ERROR HY000: Wrong parameters for versioned table `t1`: Versioning specified more than once for the same field
|
|
create or replace table t1 (
|
|
A int with system versioning without system versioning
|
|
);
|
|
ERROR HY000: Wrong parameters for versioned table `t1`: Versioning specified more than once for the same field
|
|
create table t(
|
|
a int
|
|
) without system versioning;
|
|
ERROR HY000: Wrong parameters for versioned table `t`: 'WITHOUT SYSTEM VERSIONING' is not allowed
|
|
create or replace table t1 (
|
|
A int
|
|
) without system versioning with system versioning;
|
|
ERROR HY000: Wrong parameters for versioned table `t1`: Versioning specified more than once for the same table
|
|
create or replace table t1 (
|
|
A int
|
|
) with system versioning without system versioning;
|
|
ERROR HY000: Wrong parameters for versioned table `t1`: Versioning specified more than once for the same table
|
|
create or replace table t1 (
|
|
A int
|
|
) with system versioning with system versioning;
|
|
ERROR HY000: Wrong parameters for versioned table `t1`: Versioning specified more than once for the same table
|
|
create or replace table t1 (
|
|
A int
|
|
) without system versioning without system versioning;
|
|
ERROR HY000: Wrong parameters for versioned table `t1`: Versioning specified more than once for the same table
|
|
drop table t1;
|