CREATE TABLE t1(id INT UNSIGNED AUTO_INCREMENT, x INT UNSIGNED, y 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), PRIMARY KEY (id)) WITH SYSTEM VERSIONING;
CREATE TABLE T1(id INT UNSIGNED AUTO_INCREMENT, x INT UNSIGNED, y INT UNSIGNED, PRIMARY KEY (id));
INSERT INTO t1(x, y) VALUES(1, 11);
INSERT INTO T1(x, y) VALUES(1, 11);
INSERT INTO t1(x, y) VALUES(2, 12);
INSERT INTO T1(x, y) VALUES(2, 12);
INSERT INTO t1(x, y) VALUES(3, 13);
INSERT INTO T1(x, y) VALUES(3, 13);
INSERT INTO t1(x, y) VALUES(4, 14);
INSERT INTO T1(x, y) VALUES(4, 14);
INSERT INTO t1(x, y) VALUES(5, 15);
INSERT INTO T1(x, y) VALUES(5, 15);
INSERT INTO t1(x, y) VALUES(6, 16);
INSERT INTO T1(x, y) VALUES(6, 16);
INSERT INTO t1(x, y) VALUES(7, 17);
INSERT INTO T1(x, y) VALUES(7, 17);
INSERT INTO t1(x, y) VALUES(8, 18);
INSERT INTO T1(x, y) VALUES(8, 18);
INSERT INTO t1(x, y) VALUES(9, 19);
INSERT INTO T1(x, y) VALUES(9, 19);
SELECT t1.x = T1.x AND t1.y = T1.y, t1.x, t1.y, T1.x, T1.y FROM t1 INNER JOIN T1 ON(t1.id = T1.id);
t1.x = T1.x AND t1.y = T1.y x y x y
1 1 11 1 11
1 2 12 2 12
1 3 13 3 13
1 4 14 4 14
1 5 15 5 15
1 6 16 6 16
1 7 17 7 17
1 8 18 8 18
1 9 19 9 19
DELETE FROM t1 WHERE x=2;
DELETE FROM T1 WHERE x=2;
SELECT t1.x = T1.x AND t1.y = T1.y, t1.x, t1.y, T1.x, T1.y FROM t1 INNER JOIN T1 ON(t1.id = T1.id);
t1.x = T1.x AND t1.y = T1.y x y x y
1 1 11 1 11
1 3 13 3 13
1 4 14 4 14
1 5 15 5 15
1 6 16 6 16
1 7 17 7 17
1 8 18 8 18
1 9 19 9 19
DELETE FROM t1 WHERE x>7;
DELETE FROM T1 WHERE x>7;
SELECT t1.x = T1.x AND t1.y = T1.y, t1.x, t1.y, T1.x, T1.y FROM t1 INNER JOIN T1 ON(t1.id = T1.id);
@@ -5548,68 +5548,3 @@ select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@undefined));
NULL
drop table t1;
End of 10.0 tests
#
# System Versioning Support
#
#
CREATE TABLE t1( x INT UNSIGNED, y 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;
INSERT INTO t1(x, y) VALUES
(0, 100),
(1, 101),
(2, 102),
(3, 103),
(4, 104),
(5, 105),
(6, 106),
(7, 107),
(8, 108),
(9, 109);
DELETE FROM t1 WHERE x = 3;
DELETE FROM t1 WHERE x > 7;
INSERT INTO t1(x, y) VALUES(3, 33);
SELECT @time := Sys_start FROM t1 WHERE x = 3 AND y = 33 FOR SYSTEM_TIME BETWEEN TIMESTAMP '0-0-0 0:0:0' AND TIMESTAMP '2038-01-19 04:14:07';
@time := Sys_start
Sys_start
SELECT x, y FROM t1;
x y
0 100
1 101
2 102
4 104
5 105
6 106
7 107
3 33
SET @query=CONCAT('SELECT x, y FROM t1 FOR SYSTEM_TIME FROM TIMESTAMP \'0-0-0 0:0:0\' TO TIMESTAMP \'', @time, '\'');
PREPARE stmt_t1 FROM @query;
EXECUTE stmt_t1;
x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
SET @query=CONCAT('SELECT x, y FROM t1 FOR SYSTEM_TIME BETWEEN TIMESTAMP \'0-0-0 0:0:0\' AND TIMESTAMP \'', @time, '\'');
@@ -5559,71 +5559,6 @@ select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@undefined));
NULL
drop table t1;
End of 10.0 tests
#
# System Versioning Support
#
#
CREATE TABLE t1( x INT UNSIGNED, y 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;
INSERT INTO t1(x, y) VALUES
(0, 100),
(1, 101),
(2, 102),
(3, 103),
(4, 104),
(5, 105),
(6, 106),
(7, 107),
(8, 108),
(9, 109);
DELETE FROM t1 WHERE x = 3;
DELETE FROM t1 WHERE x > 7;
INSERT INTO t1(x, y) VALUES(3, 33);
SELECT @time := Sys_start FROM t1 WHERE x = 3 AND y = 33 FOR SYSTEM_TIME BETWEEN TIMESTAMP '0-0-0 0:0:0' AND TIMESTAMP '2038-01-19 04:14:07';
@time := Sys_start
Sys_start
SELECT x, y FROM t1;
x y
0 100
1 101
2 102
4 104
5 105
6 106
7 107
3 33
SET @query=CONCAT('SELECT x, y FROM t1 FOR SYSTEM_TIME FROM TIMESTAMP \'0-0-0 0:0:0\' TO TIMESTAMP \'', @time, '\'');
PREPARE stmt_t1 FROM @query;
EXECUTE stmt_t1;
x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
SET @query=CONCAT('SELECT x, y FROM t1 FOR SYSTEM_TIME BETWEEN TIMESTAMP \'0-0-0 0:0:0\' AND TIMESTAMP \'', @time, '\'');
@@ -5548,68 +5548,3 @@ select (SELECT name FROM t1 WHERE name='tom' AND pw=PASSWORD(@undefined));
NULL
drop table t1;
End of 10.0 tests
#
# System Versioning Support
#
#
CREATE TABLE t1( x INT UNSIGNED, y 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;
INSERT INTO t1(x, y) VALUES
(0, 100),
(1, 101),
(2, 102),
(3, 103),
(4, 104),
(5, 105),
(6, 106),
(7, 107),
(8, 108),
(9, 109);
DELETE FROM t1 WHERE x = 3;
DELETE FROM t1 WHERE x > 7;
INSERT INTO t1(x, y) VALUES(3, 33);
SELECT @time := Sys_start FROM t1 WHERE x = 3 AND y = 33 FOR SYSTEM_TIME BETWEEN TIMESTAMP '0-0-0 0:0:0' AND TIMESTAMP '2038-01-19 04:14:07';
@time := Sys_start
Sys_start
SELECT x, y FROM t1;
x y
0 100
1 101
2 102
4 104
5 105
6 106
7 107
3 33
SET @query=CONCAT('SELECT x, y FROM t1 FOR SYSTEM_TIME FROM TIMESTAMP \'0-0-0 0:0:0\' TO TIMESTAMP \'', @time, '\'');
PREPARE stmt_t1 FROM @query;
EXECUTE stmt_t1;
x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
SET @query=CONCAT('SELECT x, y FROM t1 FOR SYSTEM_TIME BETWEEN TIMESTAMP \'0-0-0 0:0:0\' AND TIMESTAMP \'', @time, '\'');