| 1 |
/*M!999999\- enable the sandbox mode */ |
| 2 |
/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 3 |
/*!40101 SET character_set_client = utf8mb4 */; |
| 4 |
CREATE TABLE `sv_basic` ( |
| 5 |
`a` int(11) NOT NULL, |
| 6 |
PRIMARY KEY (`a`) |
| 7 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING; |
| 8 |
/*!40101 SET character_set_client = @saved_cs_client */; |
| 9 |
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */; |
| 10 |
INSERT INTO `sv_basic` (`a`, row_start, row_end) VALUES (1,'2023-12-19 14:23:22.304434','2038-01-19 03:14:07.999999'), |
| 11 |
(2,'2023-12-19 14:23:22.304434','2023-12-19 14:23:22.305292'), |
| 12 |
(3,'2023-12-19 14:23:22.304434','2038-01-19 03:14:07.999999'); |
| 13 |
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */; |
| 14 |
/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 15 |
/*!40101 SET character_set_client = utf8mb4 */; |
| 16 |
CREATE TABLE `sv_explicit` ( |
| 17 |
`a` int(11) DEFAULT NULL, |
| 18 |
`row_foo_start` timestamp(6) GENERATED ALWAYS AS ROW START, |
| 19 |
`row_foo_end` timestamp(6) GENERATED ALWAYS AS ROW END, |
| 20 |
PERIOD FOR SYSTEM_TIME (`row_foo_start`, `row_foo_end`) |
| 21 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING; |
| 22 |
/*!40101 SET character_set_client = @saved_cs_client */; |
| 23 |
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */; |
| 24 |
INSERT INTO `sv_explicit` VALUES |
| 25 |
(1,'2023-12-19 14:23:22.358302','2038-01-19 03:14:07.999999'), |
| 26 |
(2,'2023-12-19 14:23:22.358302','2023-12-19 14:23:22.359113'), |
| 27 |
(3,'2023-12-19 14:23:22.358302','2038-01-19 03:14:07.999999'); |
| 28 |
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */; |
| 29 |
/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 30 |
/*!40101 SET character_set_client = utf8mb4 */; |
| 31 |
CREATE TABLE `sv_partition` ( |
| 32 |
`a` int(11) NOT NULL, |
| 33 |
PRIMARY KEY (`a`) |
| 34 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING |
| 35 |
PARTITION BY SYSTEM_TIME |
| 36 |
(PARTITION `p_hist` HISTORY ENGINE = MyISAM, |
| 37 |
PARTITION `p_cur` CURRENT ENGINE = MyISAM); |
| 38 |
/*!40101 SET character_set_client = @saved_cs_client */; |
| 39 |
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */; |
| 40 |
INSERT INTO `sv_partition` (`a`, row_start, row_end) VALUES (2,'2023-12-19 14:23:22.331143','2023-12-19 14:23:22.332359'), |
| 41 |
(1,'2023-12-19 14:23:22.331143','2038-01-19 03:14:07.999999'), |
| 42 |
(3,'2023-12-19 14:23:22.331143','2038-01-19 03:14:07.999999'); |
| 43 |
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */; |
| 44 |
/*M!999999\- enable the sandbox mode */ |
| 45 |
/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 46 |
/*!40101 SET character_set_client = utf8mb4 */; |
| 47 |
CREATE TABLE `sv_basic` ( |
| 48 |
`a` int(11) NOT NULL, |
| 49 |
PRIMARY KEY (`a`) |
| 50 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING; |
| 51 |
/*!40101 SET character_set_client = @saved_cs_client */; |
| 52 |
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */; |
| 53 |
INSERT INTO `sv_basic` (`a`, row_start, row_end) VALUES (1,'2023-12-19 14:23:22.304434','2106-02-07 06:28:15.999999'), |
| 54 |
(2,'2023-12-19 14:23:22.304434','2023-12-19 14:23:22.305292'), |
| 55 |
(3,'2023-12-19 14:23:22.304434','2106-02-07 06:28:15.999999'); |
| 56 |
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */; |
| 57 |
/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 58 |
/*!40101 SET character_set_client = utf8mb4 */; |
| 59 |
CREATE TABLE `sv_explicit` ( |
| 60 |
`a` int(11) DEFAULT NULL, |
| 61 |
`row_foo_start` timestamp(6) GENERATED ALWAYS AS ROW START, |
| 62 |
`row_foo_end` timestamp(6) GENERATED ALWAYS AS ROW END, |
| 63 |
PERIOD FOR SYSTEM_TIME (`row_foo_start`, `row_foo_end`) |
| 64 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING; |
| 65 |
/*!40101 SET character_set_client = @saved_cs_client */; |
| 66 |
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */; |
| 67 |
INSERT INTO `sv_explicit` VALUES |
| 68 |
(1,'2023-12-19 14:23:22.358302','2106-02-07 06:28:15.999999'), |
| 69 |
(2,'2023-12-19 14:23:22.358302','2023-12-19 14:23:22.359113'), |
| 70 |
(3,'2023-12-19 14:23:22.358302','2106-02-07 06:28:15.999999'); |
| 71 |
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */; |
| 72 |
/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 73 |
/*!40101 SET character_set_client = utf8mb4 */; |
| 74 |
CREATE TABLE `sv_partition` ( |
| 75 |
`a` int(11) NOT NULL, |
| 76 |
PRIMARY KEY (`a`) |
| 77 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING |
| 78 |
PARTITION BY SYSTEM_TIME |
| 79 |
(PARTITION `p_hist` HISTORY ENGINE = MyISAM, |
| 80 |
PARTITION `p_cur` CURRENT ENGINE = MyISAM); |
| 81 |
/*!40101 SET character_set_client = @saved_cs_client */; |
| 82 |
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */; |
| 83 |
INSERT INTO `sv_partition` (`a`, row_start, row_end) VALUES (2,'2023-12-19 14:23:22.331143','2023-12-19 14:23:22.332359'), |
| 84 |
(1,'2023-12-19 14:23:22.331143','2106-02-07 06:28:15.999999'), |
| 85 |
(3,'2023-12-19 14:23:22.331143','2106-02-07 06:28:15.999999'); |
| 86 |
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */; |
| 87 |
test.sv_basic Needs upgrade with ALTER TABLE FORCE |
| 88 |
test.sv_explicit Needs upgrade with ALTER TABLE FORCE |
| 89 |
test.sv_partition Needs upgrade with ALTER TABLE FORCE |
| 90 |
set @@time_zone="+00:00"; |
| 91 |
select a,row_end from sv_basic for system_time all; |
| 92 |
a row_end |
| 93 |
1 2106-02-07 06:28:15.999999 |
| 94 |
2 2023-12-19 14:23:22.305292 |
| 95 |
3 2106-02-07 06:28:15.999999 |
| 96 |
select a,row_end from sv_partition for system_time all; |
| 97 |
a row_end |
| 98 |
1 2106-02-07 06:28:15.999999 |
| 99 |
2 2023-12-19 14:23:22.332359 |
| 100 |
3 2106-02-07 06:28:15.999999 |
| 101 |
select a,row_foo_end from sv_explicit for system_time all; |
| 102 |
a row_foo_end |
| 103 |
1 2106-02-07 06:28:15.999999 |
| 104 |
2 2023-12-19 14:23:22.359113 |
| 105 |
3 2106-02-07 06:28:15.999999 |
| 106 |
drop table sv_basic,sv_partition,sv_explicit; |