1
- drop table if exists t1;
2
1
create table t1 (
3
2
x1 int unsigned,
4
3
Sys_start SYS_DATATYPE as row start invisible comment 'start',
@@ -266,8 +265,8 @@ show create table t3;
266
265
Table Create Table
267
266
t3 CREATE TABLE `t3` (
268
267
`y` int(11) DEFAULT NULL,
269
- `st` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ,
270
- `en` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
268
+ `st` timestamp(6) NOT NULL,
269
+ `en` timestamp(6) NOT NULL
271
270
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
272
271
## For versioned table
273
272
insert into t1 values (1);
@@ -296,8 +295,8 @@ show create table t3;
296
295
Table Create Table
297
296
t3 CREATE TABLE `t3` (
298
297
`y` int(11) DEFAULT NULL,
299
- `st` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ,
300
- `en` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
298
+ `st` timestamp(6) NOT NULL,
299
+ `en` timestamp(6) NOT NULL
301
300
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
302
301
select * from t3 where y > 2;
303
302
y st en
@@ -385,17 +384,17 @@ show create table t2;
385
384
Table Create Table
386
385
t2 CREATE TABLE `t2` (
387
386
`x25` int(11) DEFAULT NULL,
388
- `row_start` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ,
389
- `row_end` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
387
+ `row_start` timestamp(6) NOT NULL,
388
+ `row_end` timestamp(6) NOT NULL
390
389
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
391
390
create or replace table t2 with system versioning
392
391
as select x25, row_start rs, row_end re from t1;
393
392
show create table t2;
394
393
Table Create Table
395
394
t2 CREATE TABLE `t2` (
396
395
`x25` int(11) DEFAULT NULL,
397
- `rs` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ,
398
- `re` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
396
+ `rs` timestamp(6) NOT NULL,
397
+ `re` timestamp(6) NOT NULL
399
398
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
400
399
create or replace table t1 (
401
400
x26 int,
@@ -409,8 +408,8 @@ show create table t2;
409
408
Table Create Table
410
409
t2 CREATE TABLE `t2` (
411
410
`x26` int(11) DEFAULT NULL,
412
- `st` bigint(20) unsigned NOT NULL DEFAULT 0 ,
413
- `en` bigint(20) unsigned NOT NULL DEFAULT 0
411
+ `st` bigint(20) unsigned NOT NULL,
412
+ `en` bigint(20) unsigned NOT NULL
414
413
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
415
414
create or replace table t1 (x27 int, id int) with system versioning engine NON_DEFAULT_ENGINE;
416
415
create or replace table t2 (b int, id int);
@@ -421,8 +420,8 @@ Table Create Table
421
420
t3 CREATE TABLE `t3` (
422
421
`b` int(11) DEFAULT NULL,
423
422
`x27` int(11) DEFAULT NULL,
424
- `rs` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ,
425
- `re` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
423
+ `rs` timestamp(6) NOT NULL,
424
+ `re` timestamp(6) NOT NULL
426
425
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
427
426
## Errors
428
427
create or replace temporary table t (x28 int) with system versioning;
@@ -458,10 +457,10 @@ Table Create Table
458
457
t3 CREATE TABLE `t3` (
459
458
`x30` int(11) DEFAULT NULL,
460
459
`y` int(11) DEFAULT NULL,
461
- `row_start` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ,
462
- `row_end` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ,
463
- `st` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ,
464
- `en` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
460
+ `row_start` timestamp(6) NOT NULL,
461
+ `row_end` timestamp(6) NOT NULL,
462
+ `st` timestamp(6) NOT NULL,
463
+ `en` timestamp(6) NOT NULL
465
464
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
466
465
create or replace table t3 (
467
466
y int,
@@ -475,8 +474,8 @@ Table Create Table
475
474
t3 CREATE TABLE `t3` (
476
475
`x30` int(11) DEFAULT NULL,
477
476
`y` int(11) DEFAULT NULL,
478
- `row_start` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ,
479
- `row_end` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ,
477
+ `row_start` timestamp(6) NOT NULL,
478
+ `row_end` timestamp(6) NOT NULL,
480
479
`st` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
481
480
`en` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
482
481
PERIOD FOR SYSTEM_TIME (`st`, `en`)
0 commit comments