2016-10-18 11:05:49 +02:00
|
|
|
drop table if exists t1;
|
2017-06-27 11:22:52 +02:00
|
|
|
create function if not exists non_default_engine()
|
|
|
|
returns varchar(255)
|
|
|
|
deterministic
|
|
|
|
begin
|
|
|
|
if default_engine() = 'innodb' then
|
|
|
|
return 'myisam';
|
|
|
|
end if;
|
|
|
|
return 'innodb';
|
|
|
|
end~~
|
2016-10-18 11:05:49 +02:00
|
|
|
create table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x1 int unsigned,
|
2017-05-18 15:44:29 +02:00
|
|
|
Sys_start SYS_TRX_TYPE generated always as row start comment 'start',
|
|
|
|
Sys_end SYS_TRX_TYPE generated always as row end comment 'end',
|
2016-10-18 11:05:49 +02:00
|
|
|
period for system_time (Sys_start, Sys_end)
|
|
|
|
) with system versioning;
|
|
|
|
show create table t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
2017-03-24 14:00:42 +01:00
|
|
|
`x1` int(10) unsigned DEFAULT NULL,
|
2017-05-18 15:44:29 +02:00
|
|
|
`Sys_start` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START COMMENT 'start',
|
|
|
|
`Sys_end` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END COMMENT 'end',
|
2016-10-18 11:05:49 +02:00
|
|
|
PERIOD FOR SYSTEM_TIME (`Sys_start`, `Sys_end`)
|
2017-03-24 14:00:42 +01:00
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
2016-10-18 11:05:49 +02:00
|
|
|
# Implicit fields test
|
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x2 int unsigned
|
2016-10-18 11:05:49 +02:00
|
|
|
) with system versioning;
|
|
|
|
show create table t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
2017-03-24 14:00:42 +01:00
|
|
|
`x2` int(10) unsigned DEFAULT NULL,
|
|
|
|
`sys_trx_start` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START,
|
|
|
|
`sys_trx_end` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END,
|
2016-10-18 11:05:49 +02:00
|
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
2017-03-24 14:00:42 +01:00
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x3 int unsigned,
|
|
|
|
Sys_start SYS_TRX_TYPE generated always as row start,
|
|
|
|
Sys_end SYS_TRX_TYPE generated always as row end,
|
2017-12-06 12:45:54 +01:00
|
|
|
period for system_time (x, Sys_end)
|
2016-10-18 11:05:49 +02:00
|
|
|
) with system versioning;
|
2017-12-06 12:45:54 +01:00
|
|
|
ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start` and `Sys_end`
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x4 int unsigned,
|
|
|
|
Sys_start SYS_TRX_TYPE generated always as row start,
|
|
|
|
Sys_end2 SYS_TRX_TYPE generated always as row end,
|
2016-10-18 11:05:49 +02:00
|
|
|
period for system_time (Sys_start, Sys_end)
|
|
|
|
) with system versioning;
|
2017-12-04 18:41:07 +01:00
|
|
|
ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start` and `Sys_end2`
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x5 int unsigned,
|
|
|
|
Sys_start SYS_TRX_TYPE generated always as row start,
|
|
|
|
Sys_end SYS_TRX_TYPE generated always as row end,
|
2017-12-06 12:45:54 +01:00
|
|
|
period for system_time (Sys_start, x)
|
2016-10-18 11:05:49 +02:00
|
|
|
) with system versioning;
|
2017-12-06 12:45:54 +01:00
|
|
|
ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start` and `Sys_end`
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x6 int unsigned,
|
2016-10-18 11:05:49 +02:00
|
|
|
period for system_time (Sys_start, Sys_end)
|
|
|
|
) with system versioning;
|
2017-06-29 18:35:08 +02:00
|
|
|
ERROR HY000: Wrong parameters for `t1`: missing 'AS ROW START'
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x7 int unsigned,
|
|
|
|
Sys_start SYS_TRX_TYPE generated always as row start,
|
|
|
|
Sys_end SYS_TRX_TYPE generated always as row end,
|
2016-10-18 11:05:49 +02:00
|
|
|
period for system_time (Sys_start, Sys_end)
|
|
|
|
);
|
2017-08-08 16:12:16 +02:00
|
|
|
ERROR HY000: Wrong parameters for `t1`: missing 'WITH SYSTEM VERSIONING'
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x8 int unsigned,
|
|
|
|
Sys_start SYS_TRX_TYPE generated always as row start,
|
|
|
|
Sys_end SYS_TRX_TYPE generated always as row end,
|
2016-10-18 11:05:49 +02:00
|
|
|
period for system_time (sys_insert, sys_remove)
|
|
|
|
) with system versioning;
|
2017-12-04 18:41:07 +01:00
|
|
|
ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start` and `Sys_end`
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x9 int unsigned,
|
|
|
|
Sys_start SYS_TRX_TYPE generated always as row start,
|
|
|
|
Sys_end SYS_TRX_TYPE generated always as row end,
|
2016-10-18 11:05:49 +02:00
|
|
|
period for system_time (Sys_start, Sys_end)
|
|
|
|
);
|
2017-06-29 18:35:08 +02:00
|
|
|
ERROR HY000: Wrong parameters for `t1`: missing 'WITH SYSTEM VERSIONING'
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x10 int unsigned,
|
|
|
|
Sys_start SYS_TRX_TYPE generated always as row start,
|
|
|
|
Sys_end SYS_TRX_TYPE generated always as row end,
|
2016-10-18 11:05:49 +02:00
|
|
|
period for system_time (Sys_start, Sys_start)
|
|
|
|
);
|
2017-08-08 16:12:16 +02:00
|
|
|
ERROR HY000: Wrong parameters for `t1`: missing 'WITH SYSTEM VERSIONING'
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x11 int unsigned,
|
|
|
|
Sys_start bigint unsigned generated always as row start,
|
2016-10-18 11:05:49 +02:00
|
|
|
Sys_end timestamp(6) generated always as row end,
|
|
|
|
period for system_time (Sys_start, Sys_end)
|
|
|
|
) with system versioning;
|
2017-03-24 14:00:42 +01:00
|
|
|
Got one of the listed errors
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x12 int unsigned,
|
2016-10-18 11:05:49 +02:00
|
|
|
Sys_start timestamp(6) generated always as row start,
|
2017-03-24 14:00:42 +01:00
|
|
|
Sys_end bigint unsigned generated always as row end,
|
2016-10-18 11:05:49 +02:00
|
|
|
period for system_time (Sys_start, Sys_end)
|
|
|
|
) with system versioning;
|
2017-03-24 14:00:42 +01:00
|
|
|
Got one of the listed errors
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x13 int unsigned,
|
2016-10-18 11:05:49 +02:00
|
|
|
Sys_start bigint generated always as row start,
|
2017-03-24 14:00:42 +01:00
|
|
|
Sys_end bigint unsigned generated always as row end,
|
2016-10-18 11:05:49 +02:00
|
|
|
period for system_time (Sys_start, Sys_end)
|
|
|
|
) with system versioning engine innodb;
|
2017-12-04 18:41:07 +01:00
|
|
|
ERROR HY000: `Sys_start` must be of type BIGINT(20) UNSIGNED for versioned table `t1`
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
x14 int unsigned,
|
2016-10-18 11:05:49 +02:00
|
|
|
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;
|
2017-12-04 18:41:07 +01:00
|
|
|
ERROR HY000: `Sys_end` must be of type BIGINT(20) UNSIGNED for versioned table `t1`
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
A1 int with system versioning,
|
2016-10-18 11:05:49 +02:00
|
|
|
B int
|
|
|
|
);
|
|
|
|
show create table t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
2017-03-24 14:00:42 +01:00
|
|
|
`A1` int(11) DEFAULT NULL,
|
2016-10-18 11:05:49 +02:00
|
|
|
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
|
2017-03-24 14:00:42 +01:00
|
|
|
`sys_trx_start` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START,
|
|
|
|
`sys_trx_end` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END,
|
2016-10-18 11:05:49 +02:00
|
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
2017-03-24 14:00:42 +01:00
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
A2 int with system versioning,
|
2016-10-18 11:05:49 +02:00
|
|
|
B int
|
|
|
|
) with system versioning;
|
|
|
|
show create table t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
2017-03-24 14:00:42 +01:00
|
|
|
`A2` int(11) DEFAULT NULL,
|
2016-10-18 11:05:49 +02:00
|
|
|
`B` int(11) DEFAULT NULL,
|
2017-03-24 14:00:42 +01:00
|
|
|
`sys_trx_start` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START,
|
|
|
|
`sys_trx_end` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END,
|
2016-10-18 11:05:49 +02:00
|
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
2017-03-24 14:00:42 +01:00
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
A3 int,
|
2016-10-18 11:05:49 +02:00
|
|
|
B int without system versioning
|
|
|
|
);
|
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
A4 int,
|
2016-10-18 11:05:49 +02:00
|
|
|
B int without system versioning
|
|
|
|
) with system versioning;
|
|
|
|
show create table t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
2017-03-24 14:00:42 +01:00
|
|
|
`A4` int(11) DEFAULT NULL,
|
2016-10-18 11:05:49 +02:00
|
|
|
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
|
2017-03-24 14:00:42 +01:00
|
|
|
`sys_trx_start` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START,
|
|
|
|
`sys_trx_end` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END,
|
2016-10-18 11:05:49 +02:00
|
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
2017-03-24 14:00:42 +01:00
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
A5 int with system versioning,
|
2016-10-18 11:05:49 +02:00
|
|
|
B int without system versioning
|
|
|
|
);
|
|
|
|
show create table t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
2017-03-24 14:00:42 +01:00
|
|
|
`A5` int(11) DEFAULT NULL,
|
2016-10-18 11:05:49 +02:00
|
|
|
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
|
2017-03-24 14:00:42 +01:00
|
|
|
`sys_trx_start` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START,
|
|
|
|
`sys_trx_end` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END,
|
2016-10-18 11:05:49 +02:00
|
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
2017-03-24 14:00:42 +01:00
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
A6 int with system versioning,
|
2016-10-18 11:05:49 +02:00
|
|
|
B int without system versioning
|
|
|
|
) with system versioning;
|
|
|
|
show create table t1;
|
|
|
|
Table Create Table
|
|
|
|
t1 CREATE TABLE `t1` (
|
2017-03-24 14:00:42 +01:00
|
|
|
`A6` int(11) DEFAULT NULL,
|
2016-10-18 11:05:49 +02:00
|
|
|
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
|
2017-03-24 14:00:42 +01:00
|
|
|
`sys_trx_start` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START,
|
|
|
|
`sys_trx_end` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END,
|
2016-10-18 11:05:49 +02:00
|
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
2017-03-24 14:00:42 +01:00
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
2016-10-18 11:05:49 +02:00
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
A7 int without system versioning
|
2016-10-18 11:05:49 +02:00
|
|
|
);
|
|
|
|
create or replace table t1 (
|
2017-03-24 14:00:42 +01:00
|
|
|
A8 int without system versioning
|
2016-10-18 11:05:49 +02:00
|
|
|
) with system versioning;
|
2017-12-04 18:41:07 +01:00
|
|
|
ERROR HY000: Table `t1` has no versioned columns
|
2017-03-04 21:05:45 +01:00
|
|
|
create or replace table t1 (a int) with system versioning;
|
2017-03-06 13:53:53 +01:00
|
|
|
create table tt1 like t1;
|
|
|
|
show create table tt1;
|
|
|
|
Table Create Table
|
|
|
|
tt1 CREATE TABLE `tt1` (
|
|
|
|
`a` int(11) DEFAULT NULL,
|
2017-03-24 14:00:42 +01:00
|
|
|
`sys_trx_start` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START,
|
|
|
|
`sys_trx_end` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END,
|
2017-03-06 13:53:53 +01:00
|
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
2017-03-24 14:00:42 +01:00
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
2017-03-06 13:53:53 +01:00
|
|
|
drop table tt1;
|
2017-12-01 08:08:57 +01:00
|
|
|
create temporary table tt1 like t1;
|
|
|
|
Warnings:
|
|
|
|
Warning 1105 System versioning is stripped from temporary `test.tt1`
|
|
|
|
# Temporary is stripped from versioning
|
|
|
|
show create table tt1;
|
|
|
|
Table Create Table
|
|
|
|
tt1 CREATE TEMPORARY TABLE `tt1` (
|
|
|
|
`a` int(11) DEFAULT NULL
|
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1
|
2017-03-24 14:00:42 +01:00
|
|
|
create or replace table t1 (x int) with system versioning;
|
2017-07-03 16:38:59 +02:00
|
|
|
create or replace table t0(
|
2017-03-24 14:00:42 +01:00
|
|
|
y int,
|
|
|
|
st SYS_TRX_TYPE generated always as row start,
|
|
|
|
en SYS_TRX_TYPE generated always as row end,
|
|
|
|
period for system_time (st, en)
|
|
|
|
) with system versioning;
|
2017-07-03 16:38:59 +02:00
|
|
|
create or replace table t2 as select * from t1;
|
|
|
|
show create table t2;
|
|
|
|
Table Create Table
|
|
|
|
t2 CREATE TABLE `t2` (
|
|
|
|
`x` int(11) DEFAULT NULL
|
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1
|
|
|
|
create or replace table t3 as select * from t0;
|
|
|
|
show create table t3;
|
|
|
|
Table Create Table
|
|
|
|
t3 CREATE TABLE `t3` (
|
|
|
|
`y` int(11) DEFAULT NULL
|
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1
|
|
|
|
insert into t1 values (1);
|
|
|
|
insert into t0 values (2);
|
|
|
|
create or replace table t2 with system versioning as select * from t1;
|
|
|
|
show create table t2;
|
|
|
|
Table Create Table
|
|
|
|
t2 CREATE TABLE `t2` (
|
|
|
|
`x` int(11) DEFAULT NULL,
|
|
|
|
`sys_trx_start` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START,
|
|
|
|
`sys_trx_end` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END,
|
|
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
|
|
|
select * from t2;
|
|
|
|
x
|
|
|
|
1
|
|
|
|
create or replace table t3 with system versioning as select * from t0;
|
2017-03-24 14:00:42 +01:00
|
|
|
show create table t3;
|
|
|
|
Table Create Table
|
|
|
|
t3 CREATE TABLE `t3` (
|
|
|
|
`y` int(11) DEFAULT NULL,
|
|
|
|
`st` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START,
|
|
|
|
`en` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END,
|
|
|
|
PERIOD FOR SYSTEM_TIME (`st`, `en`)
|
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
2017-07-03 16:38:59 +02:00
|
|
|
select * from t3 where y > 2;
|
|
|
|
y st en
|
|
|
|
delete from t0;
|
|
|
|
create or replace table t1 (x int) with system versioning;
|
|
|
|
create or replace table t2 (y int);
|
|
|
|
create or replace table t3 with system versioning select * from t1 for system_time all, t2;
|
|
|
|
show create table t3;
|
|
|
|
Table Create Table
|
|
|
|
t3 CREATE TABLE `t3` (
|
|
|
|
`x` int(11) DEFAULT NULL,
|
|
|
|
`sys_trx_start` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START,
|
|
|
|
`sys_trx_end` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END,
|
|
|
|
`y` int(11) DEFAULT NULL,
|
|
|
|
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
|
|
|
|
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
|
|
|
create or replace table t2 with system versioning as select * from t0;
|
|
|
|
create or replace table t3 with system versioning select x, y, t1.sys_trx_start, t2.en from t1, t2;
|
2017-03-24 14:00:42 +01:00
|
|
|
ERROR HY000: Wrong parameters for `t3`: system fields selected from different tables
|
|
|
|
insert into t2 values (1), (2);
|
|
|
|
delete from t2 where y = 2;
|
|
|
|
create or replace table t3 select * from t2 for system_time all;
|
|
|
|
select st, en from t2 where y = 1 into @st, @en;
|
|
|
|
select y from t2 for system_time all where st = @st and en = @en;
|
|
|
|
y
|
|
|
|
1
|
|
|
|
select st, en from t2 for system_time all where y = 2 into @st, @en;
|
|
|
|
select y from t2 for system_time all where st = @st and en = @en;
|
|
|
|
y
|
|
|
|
2
|
2017-06-27 11:22:52 +02:00
|
|
|
create or replace table t1 (a int) with system versioning engine INNODB_OR_MYISAM;
|
|
|
|
create or replace table t2 as select a, sys_trx_start, sys_trx_end from t1 for system_time all;
|
2017-07-03 16:38:59 +02:00
|
|
|
create or replace table t2 with system versioning engine INNODB_OR_MYISAM as select a, sys_trx_start, sys_trx_end from t1 for system_time all;
|
2017-12-04 18:41:07 +01:00
|
|
|
ERROR HY000: `sys_trx_start` must be of type SYS_TRX_TYPE for versioned table `t2`
|
2017-06-27 11:22:52 +02:00
|
|
|
create or replace table t1 (a int, id int) with system versioning engine INNODB_OR_MYISAM;
|
|
|
|
create or replace table t2 (b int, id int);
|
|
|
|
create or replace table t3 as
|
|
|
|
select t2.b, t1.a, t1.sys_trx_start, t1.sys_trx_end from t2 inner join t1 on t2.id=t1.id;
|
2017-08-18 14:30:55 +02:00
|
|
|
create or replace table t (sys_trx_start int);
|
|
|
|
alter table t with system versioning;
|
|
|
|
ERROR 42S21: Duplicate column name 'sys_trx_start'
|
|
|
|
create or replace table t (sys_trx_end int);
|
|
|
|
alter table t with system versioning;
|
|
|
|
ERROR 42S21: Duplicate column name 'sys_trx_end'
|
2017-11-24 15:44:43 +01:00
|
|
|
create or replace temporary table t (x int) with system versioning;
|
|
|
|
ERROR HY000: Incorrect usage of TEMPORARY and WITH SYSTEM VERSIONING
|
2017-12-06 12:45:54 +01:00
|
|
|
create or replace table t1 (
|
|
|
|
x11 int unsigned,
|
|
|
|
Sys_start0 timestamp(6) generated always as row start,
|
|
|
|
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;
|
|
|
|
ERROR HY000: Duplicate ROW START column `Sys_start`
|
2017-07-03 16:38:59 +02:00
|
|
|
drop database test;
|
|
|
|
create database test;
|