1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Merge 10.5 into 10.6

This commit is contained in:
Marko Mäkelä
2021-04-14 12:32:27 +03:00
145 changed files with 2835 additions and 1503 deletions

View File

@@ -80,7 +80,7 @@ t CREATE TABLE `t` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t add column trx_start timestamp(6) as row start;
ERROR HY000: Duplicate ROW START column `trx_start`
ERROR HY000: Table `t` is not system-versioned
alter table t add system versioning;
show create table t;
Table Create Table
@@ -697,6 +697,55 @@ set statement system_versioning_alter_history=keep for
alter table t1 drop system versioning, modify column a tinyint;
drop table t1;
#
# MDEV-24690 Dropping primary key column from versioned table always fails with 1072
#
create table t1 (a int, b int primary key) with system versioning;
alter table t1 drop column b;
create or replace table t1 (
a int, b int primary key,
row_start timestamp(6) as row start,
row_end timestamp(6) as row end,
period for system_time(row_start, row_end)
) with system versioning;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) NOT NULL,
`row_start` timestamp(6) GENERATED ALWAYS AS ROW START,
`row_end` timestamp(6) GENERATED ALWAYS AS ROW END,
PRIMARY KEY (`b`,`row_end`),
PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
alter table t1 drop column b;
ERROR 42000: Key column 'b' doesn't exist in table
create or replace table t1 (
a int, b int primary key,
row_start timestamp(6) as row start invisible,
row_end timestamp(6) as row end invisible,
period for system_time(row_start, row_end)
) with system versioning;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) NOT NULL,
`row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
`row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
PRIMARY KEY (`b`,`row_end`),
PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
alter table t1 drop column b;
ERROR 42000: Key column 'b' doesn't exist in table
drop table t1;
#
# MDEV-25172 Wrong error message for ADD COLUMN .. AS ROW START
#
create or replace table t1 (x int);
alter table t1 add column y timestamp(6) as row start;
ERROR HY000: Table `t1` is not system-versioned
drop table t1;
#
# MDEV-21941 RENAME doesn't work for system time or period fields
#
create or replace table t1 (a int) with system versioning;

View File

@@ -63,3 +63,13 @@ A x y x y
1 7 17 7 17
drop table t1;
drop table t2;
#
# MDEV-22562 Assertion `next_insert_id == 0' upon UPDATE on system-versioned table
#
create table t1 (pk integer auto_increment primary key) engine=myisam with system versioning;
insert delayed into t1 (pk) values (1);
lock tables t1 write;
update t1 set pk= 0;
update t1 set pk= 0;
unlock tables;
drop table t1;

View File

@@ -68,7 +68,7 @@ select row_start from t;
alter table t drop system versioning;
show create table t;
--error ER_VERS_DUPLICATE_ROW_START_END
--error ER_VERS_NOT_VERSIONED
alter table t add column trx_start timestamp(6) as row start;
alter table t add system versioning;
@@ -594,6 +594,44 @@ alter table t1 drop system versioning, modify column a tinyint;
# cleanup
drop table t1;
--echo #
--echo # MDEV-24690 Dropping primary key column from versioned table always fails with 1072
--echo #
create table t1 (a int, b int primary key) with system versioning;
alter table t1 drop column b;
create or replace table t1 (
a int, b int primary key,
row_start timestamp(6) as row start,
row_end timestamp(6) as row end,
period for system_time(row_start, row_end)
) with system versioning;
show create table t1;
--error ER_KEY_COLUMN_DOES_NOT_EXITS
alter table t1 drop column b;
create or replace table t1 (
a int, b int primary key,
row_start timestamp(6) as row start invisible,
row_end timestamp(6) as row end invisible,
period for system_time(row_start, row_end)
) with system versioning;
show create table t1;
--error ER_KEY_COLUMN_DOES_NOT_EXITS
alter table t1 drop column b;
# cleanup
drop table t1;
--echo #
--echo # MDEV-25172 Wrong error message for ADD COLUMN .. AS ROW START
--echo #
create or replace table t1 (x int);
--error ER_VERS_NOT_VERSIONED
alter table t1 add column y timestamp(6) as row start;
# cleanup
drop table t1;
--echo #
--echo # MDEV-21941 RENAME doesn't work for system time or period fields
--echo #

View File

@@ -47,4 +47,17 @@ select t1.x = t2.x and t1.y = t2.y as A, t1.x, t1.y, t2.x, t2.y from t1 inner jo
drop table t1;
drop table t2;
--echo #
--echo # MDEV-22562 Assertion `next_insert_id == 0' upon UPDATE on system-versioned table
--echo #
create table t1 (pk integer auto_increment primary key) engine=myisam with system versioning;
insert delayed into t1 (pk) values (1);
lock tables t1 write;
update t1 set pk= 0;
update t1 set pk= 0;
unlock tables;
# cleanup
drop table t1;
-- source suite/versioning/common_finish.inc