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

Merge branch '11.6' into 11.7

This commit is contained in:
Oleksandr Byelkin
2024-11-09 19:01:12 +01:00
789 changed files with 10342 additions and 4415 deletions

View File

@@ -98,10 +98,10 @@ CREATE TABLE `t1` (
`x` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci WITH SYSTEM VERSIONING;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
INSERT INTO `t1` (`x`, row_start, row_end) VALUES (1,'2010-10-10 10:10:10.101010','2011-11-11 11:11:11.111111'),
(2,'2010-10-10 10:10:10.101010','MAX_TIME');
/*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t2` (
@@ -111,10 +111,10 @@ CREATE TABLE `t2` (
PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci WITH SYSTEM VERSIONING;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
INSERT INTO `t2` (`x`, `row_start`, `row_end`) VALUES (1,'2010-10-10 10:10:10.101010','2011-11-11 11:11:11.111111'),
(2,'2010-10-10 10:10:10.101010','MAX_TIME');
/*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
mariadb-dump: --dump-history can't be used with --as-of.
mariadb-dump: --dump-history can't be used with --replace.
mariadb-dump: --xml can't be used with --dump-history.

View File

@@ -222,6 +222,17 @@ DROP VIEW v1;
DROP TABLE t1;
# End of 10.4 tests
#
# MDEV-33470 Unique hash index is broken on DML for system-versioned table
#
create or replace table t (
c int, unique (c) using hash)
with system versioning;
insert into t values (0);
delete from t;
delete history from t;
drop table t;
# End of 10.5 tests
#
# MDEV-17554 Auto-create new partition for system versioned tables with history partitioned by INTERVAL/LIMIT
#
# Don't auto-create new partition on DELETE HISTORY:

View File

@@ -126,7 +126,7 @@ row_end timestamp(6) as row end,
period for system_time (row_start, row_end))
with system versioning;
insert into t1(x, row_start, row_end) values (2, '1980-01-01 00:00:00', '1980-01-01 00:00:01');
ERROR 42S22: Unknown column 'row_start' in 'field list'
ERROR 42S22: Unknown column 'row_start' in 'INSERT INTO'
insert into t2(y, row_start, row_end) values (2, '1980-01-01 00:00:00', '1980-01-01 00:00:01');
ERROR HY000: The value specified for generated column 'row_start' in table 't2' has been ignored
set @@system_versioning_insert_history= 1;
@@ -154,11 +154,11 @@ insert into t1(x) values (1);
insert into t2(y) values (1);
update t1 set x= x + 1;
update t1 set row_start= '1971-01-01 00:00:00';
ERROR 42S22: Unknown column 'row_start' in 'field list'
ERROR 42S22: Unknown column 'row_start' in 'SET'
update t2 set row_start= '1971-01-01 00:00:00';
ERROR HY000: The value specified for generated column 'row_start' in table 't2' has been ignored
insert t1 (x) values (2) on duplicate key update x= 3, row_end= '1970-01-01 00:00:00';
ERROR 42S22: Unknown column 'row_end' in 'field list'
ERROR 42S22: Unknown column 'row_end' in 'UPDATE'
insert t2 (y) values (1) on duplicate key update y= 3, row_end= '1970-01-01 00:00:00';
ERROR HY000: The value specified for generated column 'row_end' in table 't2' has been ignored
insert t2 (y,row_end) values (1, '1970-01-01 00:00:00') on duplicate key update y= 3;
@@ -227,13 +227,13 @@ replace into t2 (a, row_start, row_end) select x, row_start, row_end from t1;
ERROR HY000: The value specified for generated column 'row_start' in table 't2' has been ignored
create or replace table t2 (a int primary key) with system versioning;
replace into t2 (a, row_start, row_end) values (1, '1980-01-01 00:00:00', '1980-01-01 00:00:01');
ERROR 42S22: Unknown column 'row_start' in 'field list'
ERROR 42S22: Unknown column 'row_start' in 'INSERT INTO'
replace into t2 (a, row_start, row_end) select x, row_start, row_end from t1;
ERROR 42S22: Unknown column 'row_start' in 'field list'
ERROR 42S22: Unknown column 'row_start' in 'INSERT INTO'
set @@system_versioning_insert_history= 1;
# REPLACE ignores system_versioning_insert_history
replace into t2 (a, row_end) values (0, '1980-01-01 00:00:00');
ERROR 42S22: Unknown column 'row_end' in 'field list'
ERROR 42S22: Unknown column 'row_end' in 'INSERT INTO'
replace into t3 (z, row_start) values (0, '1980-01-01 00:00:00');
ERROR HY000: The value specified for generated column 'row_start' in table 't3' has been ignored
replace into t3 values (0, '1980-01-01 00:00:00', '1981-01-01 00:00:00');

View File

@@ -6,11 +6,11 @@ CREATE TABLE `sv_basic` (
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
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'),
(2,'2023-12-19 14:23:22.304434','2023-12-19 14:23:22.305292'),
(3,'2023-12-19 14:23:22.304434','2038-01-19 03:14:07.999999');
/*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sv_explicit` (
@@ -20,12 +20,12 @@ CREATE TABLE `sv_explicit` (
PERIOD FOR SYSTEM_TIME (`row_foo_start`, `row_foo_end`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
INSERT INTO `sv_explicit` VALUES
(1,'2023-12-19 14:23:22.358302','2038-01-19 03:14:07.999999'),
(2,'2023-12-19 14:23:22.358302','2023-12-19 14:23:22.359113'),
(3,'2023-12-19 14:23:22.358302','2038-01-19 03:14:07.999999');
/*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sv_partition` (
@@ -36,11 +36,11 @@ CREATE TABLE `sv_partition` (
(PARTITION `p_hist` HISTORY ENGINE = MyISAM,
PARTITION `p_cur` CURRENT ENGINE = MyISAM);
/*!40101 SET character_set_client = @saved_cs_client */;
/*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
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'),
(1,'2023-12-19 14:23:22.331143','2038-01-19 03:14:07.999999'),
(3,'2023-12-19 14:23:22.331143','2038-01-19 03:14:07.999999');
/*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*M!999999\- enable the sandbox mode */
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -49,11 +49,11 @@ CREATE TABLE `sv_basic` (
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
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'),
(2,'2023-12-19 14:23:22.304434','2023-12-19 14:23:22.305292'),
(3,'2023-12-19 14:23:22.304434','2106-02-07 06:28:15.999999');
/*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sv_explicit` (
@@ -63,12 +63,12 @@ CREATE TABLE `sv_explicit` (
PERIOD FOR SYSTEM_TIME (`row_foo_start`, `row_foo_end`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
INSERT INTO `sv_explicit` VALUES
(1,'2023-12-19 14:23:22.358302','2106-02-07 06:28:15.999999'),
(2,'2023-12-19 14:23:22.358302','2023-12-19 14:23:22.359113'),
(3,'2023-12-19 14:23:22.358302','2106-02-07 06:28:15.999999');
/*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sv_partition` (
@@ -79,11 +79,11 @@ CREATE TABLE `sv_partition` (
(PARTITION `p_hist` HISTORY ENGINE = MyISAM,
PARTITION `p_cur` CURRENT ENGINE = MyISAM);
/*!40101 SET character_set_client = @saved_cs_client */;
/*!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
/*M!101100 SET @old_system_versioning_insert_history=@@session.system_versioning_insert_history, @@session.system_versioning_insert_history=1 */;
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'),
(1,'2023-12-19 14:23:22.331143','2106-02-07 06:28:15.999999'),
(3,'2023-12-19 14:23:22.331143','2106-02-07 06:28:15.999999');
/*!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
/*M!101100 SET system_versioning_insert_history=@old_system_versioning_insert_history */;
test.sv_basic Needs upgrade with ALTER TABLE FORCE
test.sv_explicit Needs upgrade with ALTER TABLE FORCE
test.sv_partition Needs upgrade with ALTER TABLE FORCE

View File

@@ -464,7 +464,7 @@ set timestamp= default;
create table t1(x int) with system versioning;
insert into t1(x) values (1);
insert into t1(x, row_start, row_end) values (2, '1980-01-01 00:00:00', '1980-01-01 00:00:01');
ERROR 42S22: Unknown column 'row_start' in 'field list'
ERROR 42S22: Unknown column 'row_start' in 'INSERT INTO'
set @@system_versioning_insert_history= 1;
insert into t1(x, row_start, row_end) values (3, '1980-01-01 00:00:00', '1980-01-01 00:00:01');
update t1 set x= x + 1;

View File

@@ -50,6 +50,30 @@ x y
connection master;
drop table t1;
#
# MDEV-31297 Create table as select on system versioned tables do not work consistently on replication
#
connection master;
create table t engine=innodb with system versioning as select 1 as i;
show create table t;
Table Create Table
t CREATE TABLE `t` (
`i` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci WITH SYSTEM VERSIONING
select * from t;
i
1
connection slave;
show create table t;
Table Create Table
t CREATE TABLE `t` (
`i` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci WITH SYSTEM VERSIONING
select * from t;
i
1
connection master;
drop table t;
#
# MDEV-25347 DML events for auto-partitioned tables are written into binary log twice
#
flush binary logs;

View File

@@ -333,9 +333,9 @@ create or replace table t1 (a int) with system versioning;
create or replace view v1 as select * from t1;
create or replace procedure sp() update v1 set xx = 1;
call sp;
ERROR 42S22: Unknown column 'xx' in 'field list'
ERROR 42S22: Unknown column 'xx' in 'SET'
call sp;
ERROR 42S22: Unknown column 'xx' in 'field list'
ERROR 42S22: Unknown column 'xx' in 'SET'
drop procedure sp;
drop view v1;
drop table t1;

View File

@@ -228,6 +228,19 @@ DROP TABLE t1;
--echo # End of 10.4 tests
--echo #
--echo # MDEV-33470 Unique hash index is broken on DML for system-versioned table
--echo #
create or replace table t (
c int, unique (c) using hash)
with system versioning;
insert into t values (0);
delete from t;
delete history from t;
drop table t;
--echo # End of 10.5 tests
--echo #
--echo # MDEV-17554 Auto-create new partition for system versioned tables with history partitioned by INTERVAL/LIMIT
--echo #

View File

@@ -59,4 +59,19 @@ drop table t1;
--remove_files_wildcard $TMP *.txt
--remove_files_wildcard $TMP *.sql
--echo #
--echo # MDEV-31297 Create table as select on system versioned tables do not work consistently on replication
--echo #
--connection master
create table t engine=innodb with system versioning as select 1 as i;
show create table t;
select * from t;
--sync_slave_with_master
show create table t;
select * from t;
--connection master
drop table t;
--source rpl_common.inc