summaryrefslogtreecommitdiff
path: root/mysql-test/t/auto_increment.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/auto_increment.test')
-rw-r--r--mysql-test/t/auto_increment.test34
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index 7f0ab5dc169..dca4b026c80 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -397,3 +397,37 @@ insert into t1 values(null);
select last_insert_id();
select * from t1;
drop table t1;
+
+--echo #
+--echo # System Versioning Support
+--echo #
+--echo #
+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);
+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);
+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);
+DROP TABLE t1;
+DROP TABLE T1;