1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge 10.4 to 10.5

This commit is contained in:
Marko Mäkelä
2020-10-22 17:08:49 +03:00
185 changed files with 3709 additions and 657 deletions

View File

@@ -536,3 +536,59 @@ with system versioning
select 1 as x;
ERROR HY000: Table `t1` must have at least one versioned column
drop tables t0, t1, t2, t3;
#
# MDEV-23968 CREATE TEMPORARY TABLE .. LIKE (system versioned table) returns error if unique index is defined in the table
#
create table t1 (id int primary key, index(row_start)) with system versioning;
ERROR 42000: Key column 'row_start' doesn't exist in table
create table t1 (id int primary key, index(row_end)) with system versioning;
ERROR 42000: Key column 'row_end' doesn't exist in table
create table t1 (id int, primary key(id, row_end, row_end)) with system versioning;
ERROR 42000: Key column 'row_end' doesn't exist in table
create table t1 (id int primary key) with system versioning;
create temporary table t2 like t1;
Warnings:
Warning 1105 System versioning is stripped from temporary `test.t2`
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 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
drop temporary table t2;
create or replace table t1 (
a int,
row_start timestamp(6) as row start,
row_end timestamp(6) as row end,
period for system_time (row_start, row_end),
index(row_start),
index(row_end),
primary key(row_end, a, row_start),
index(row_end, row_start, a)) with system versioning;
create temporary table t2 like t1;
Warnings:
Warning 1105 System versioning is stripped from temporary `test.t2`
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`row_start` timestamp(6) GENERATED ALWAYS AS ROW START,
`row_end` timestamp(6) GENERATED ALWAYS AS ROW END,
PRIMARY KEY (`row_end`,`a`,`row_start`),
KEY `row_start` (`row_start`),
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
show create table t2;
Table Create Table
t2 CREATE TEMPORARY TABLE `t2` (
`a` int(11) NOT NULL
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
drop temporary table t2;
drop table t1;