mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.5 into 10.6
This commit is contained in:
@@ -12,7 +12,7 @@ t1 CREATE TABLE `t1` (
|
||||
`Sys_start` SYS_DATATYPE GENERATED ALWAYS AS ROW START INVISIBLE COMMENT 'start',
|
||||
`Sys_end` SYS_DATATYPE GENERATED ALWAYS AS ROW END INVISIBLE COMMENT 'end',
|
||||
PERIOD FOR SYSTEM_TIME (`Sys_start`, `Sys_end`)
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
select table_catalog,table_schema,table_name,table_type,version,table_rows,data_free,auto_increment,check_time,table_collation,checksum,create_options,table_comment from information_schema.tables where table_name='t1';
|
||||
table_catalog def
|
||||
table_schema test
|
||||
@@ -81,7 +81,7 @@ show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x2` int(10) unsigned DEFAULT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
create or replace table t1 (
|
||||
x3 int unsigned,
|
||||
Sys_start timestamp(6) as row start invisible,
|
||||
@@ -173,7 +173,7 @@ Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x15` int(11) DEFAULT NULL,
|
||||
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
create or replace table t1 (
|
||||
x16 int with system versioning,
|
||||
B int
|
||||
@@ -183,7 +183,7 @@ Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x16` int(11) DEFAULT NULL,
|
||||
`B` int(11) DEFAULT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
create or replace table t1 (
|
||||
x17 int,
|
||||
B int without system versioning
|
||||
@@ -197,7 +197,7 @@ Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x18` int(11) DEFAULT NULL,
|
||||
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
create or replace table t1 (
|
||||
x19 int with system versioning,
|
||||
B int without system versioning
|
||||
@@ -207,7 +207,7 @@ Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x19` int(11) DEFAULT NULL,
|
||||
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
create or replace table t1 (
|
||||
x20 int with system versioning,
|
||||
B int without system versioning
|
||||
@@ -217,7 +217,7 @@ Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x20` int(11) DEFAULT NULL,
|
||||
`B` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
create or replace table t1 (
|
||||
x21 int without system versioning
|
||||
);
|
||||
@@ -231,7 +231,7 @@ show create table tt1;
|
||||
Table Create Table
|
||||
tt1 CREATE TABLE `tt1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
drop table tt1;
|
||||
create temporary table tt1 like t1;
|
||||
Warnings:
|
||||
@@ -241,7 +241,7 @@ show create table tt1;
|
||||
Table Create Table
|
||||
tt1 CREATE TEMPORARY TABLE `tt1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
# CREATE TABLE ... SELECT
|
||||
create or replace table t1 (x23 int) with system versioning;
|
||||
create or replace table t0(
|
||||
@@ -257,7 +257,7 @@ show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`x23` int(11) DEFAULT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
### 2. all visible fields are included
|
||||
create or replace table t3 as select * from t0;
|
||||
select * from t0;
|
||||
@@ -268,7 +268,7 @@ t3 CREATE TABLE `t3` (
|
||||
`y` int(11) DEFAULT NULL,
|
||||
`st` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
|
||||
`en` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
## For versioned table
|
||||
insert into t1 values (1);
|
||||
select row_start from t1 into @row_start;
|
||||
@@ -283,7 +283,7 @@ show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`x23` int(11) DEFAULT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
#### invisible fields are not copied
|
||||
select * from t2;
|
||||
x23
|
||||
@@ -298,7 +298,7 @@ t3 CREATE TABLE `t3` (
|
||||
`y` int(11) DEFAULT NULL,
|
||||
`st` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
|
||||
`en` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
select * from t3 where y > 2;
|
||||
y st en
|
||||
select y from t3 where st = @st and row_start > @st;
|
||||
@@ -317,7 +317,7 @@ t3 CREATE TABLE `t3` (
|
||||
`st` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
|
||||
`en` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
|
||||
PERIOD FOR SYSTEM_TIME (`st`, `en`)
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
select y from t3;
|
||||
y
|
||||
2
|
||||
@@ -329,7 +329,7 @@ show create table t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`x23` int(11) DEFAULT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
select * from t3;
|
||||
x23
|
||||
1
|
||||
@@ -355,7 +355,7 @@ Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`x23` int(11) DEFAULT NULL,
|
||||
`y` int(11) DEFAULT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
select * from t3 for system_time all;
|
||||
x23 y
|
||||
1 3
|
||||
@@ -387,7 +387,7 @@ t2 CREATE TABLE `t2` (
|
||||
`x25` int(11) DEFAULT NULL,
|
||||
`row_start` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
|
||||
`row_end` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
create or replace table t2 with system versioning
|
||||
as select x25, row_start rs, row_end re from t1;
|
||||
show create table t2;
|
||||
@@ -396,7 +396,7 @@ t2 CREATE TABLE `t2` (
|
||||
`x25` int(11) DEFAULT NULL,
|
||||
`rs` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
|
||||
`re` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
create or replace table t1 (
|
||||
x26 int,
|
||||
st bigint unsigned as row start,
|
||||
@@ -411,7 +411,7 @@ t2 CREATE TABLE `t2` (
|
||||
`x26` int(11) DEFAULT NULL,
|
||||
`st` bigint(20) unsigned NOT NULL DEFAULT 0,
|
||||
`en` bigint(20) unsigned NOT NULL DEFAULT 0
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
create or replace table t1 (x27 int, id int) with system versioning engine NON_DEFAULT_ENGINE;
|
||||
create or replace table t2 (b int, id int);
|
||||
create or replace table t3 with system versioning
|
||||
@@ -423,7 +423,7 @@ t3 CREATE TABLE `t3` (
|
||||
`x27` int(11) DEFAULT NULL,
|
||||
`rs` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
|
||||
`re` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
## Errors
|
||||
create or replace temporary table t (x28 int) with system versioning;
|
||||
ERROR HY000: System-versioned tables do not support CREATE TEMPORARY TABLE
|
||||
@@ -462,7 +462,7 @@ t3 CREATE TABLE `t3` (
|
||||
`row_end` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
|
||||
`st` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
|
||||
`en` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
create or replace table t3 (
|
||||
y int,
|
||||
st timestamp(6) as row start invisible,
|
||||
@@ -480,7 +480,7 @@ t3 CREATE TABLE `t3` (
|
||||
`st` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
|
||||
`en` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
|
||||
PERIOD FOR SYSTEM_TIME (`st`, `en`)
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
# MDEV-14828 Server crashes in JOIN::prepare / setup_fields on 2nd execution of PS [#437]
|
||||
create or replace table t1 (x int) with system versioning;
|
||||
prepare bad from 'create or replace table t2 with system versioning as select * from t1';
|
||||
@@ -499,13 +499,13 @@ show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`i` int(1) NOT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
create or replace table t1 (i int) with system versioning as select 1 as i;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
create or replace table t1 (
|
||||
a int,
|
||||
row_start bigint as row start,
|
||||
@@ -554,12 +554,12 @@ Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TEMPORARY TABLE `t2` (
|
||||
`id` int(11) NOT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop temporary table t2;
|
||||
create or replace table t1 (
|
||||
a int,
|
||||
@@ -584,12 +584,12 @@ t1 CREATE TABLE `t1` (
|
||||
KEY `row_end` (`row_end`),
|
||||
KEY `row_end_2` (`row_end`,`row_start`,`a`),
|
||||
PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TEMPORARY TABLE `t2` (
|
||||
`a` int(11) NOT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop temporary table t2;
|
||||
drop table t1;
|
||||
#
|
||||
@@ -609,7 +609,7 @@ t1 CREATE TABLE `t1` (
|
||||
`id` int(11) NOT NULL,
|
||||
`x` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-26928 Column-inclusive WITH SYSTEM VERSIONING doesn't work with explicit system fields
|
||||
@@ -620,7 +620,7 @@ Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
|
||||
`y` int(11) DEFAULT NULL
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
create or replace table t1 (
|
||||
x int, y int with system versioning,
|
||||
row_start timestamp(6) as row start,
|
||||
@@ -634,7 +634,7 @@ t1 CREATE TABLE `t1` (
|
||||
`row_start` timestamp(6) GENERATED ALWAYS AS ROW START,
|
||||
`row_end` timestamp(6) GENERATED ALWAYS AS ROW END,
|
||||
PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-27452 TIMESTAMP(0) system field is allowed for certain creation of system-versioned table
|
||||
|
Reference in New Issue
Block a user