1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.11 -> 11.4

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2024-12-05 11:01:42 +01:00
78 changed files with 1333 additions and 273 deletions

View File

@@ -95,6 +95,33 @@ SELECT * FROM test.regular_tbl ORDER BY fkid LIMIT 2;
--replace_column 2 date-time 3 USER 4 UUID
SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
--echo *** MDEV-5798: Wrong errorcode for missing partition after TRUNCATE PARTITION
--connection master
eval CREATE TABLE t1 (a INT)
ENGINE=$engine_type
PARTITION BY LIST(a) (
PARTITION p0 VALUES IN (9, NULL),
PARTITION p1 VALUES IN (8, 2, 7),
PARTITION p2 VALUES IN (6, 4, 5),
PARTITION p3 VALUES IN (3, 1, 0)
);
ALTER TABLE t1 DROP PARTITION p0;
# This failed statement leaves ALTER_PARTITION_TRUNCATE set in
# thd->lex->alter_info.partition_flags
--error ER_NO_SUCH_TABLE
ALTER TABLE non_existent TRUNCATE PARTITION p1,p2;
# The bug was that the code would wrongly look at the (now stale) value of
# thd->lex->alter_info.partition_flags and give the wrong error code
# ER_WRONG_PARTITION_NAME.
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
INSERT INTO t1 PARTITION (p1,p2,p3) VALUES (0),(9);
--sync_slave_with_master
###### CLEAN UP SECTION ##############
connection master;
@@ -102,3 +129,4 @@ DROP PROCEDURE test.proc_norm;
DROP PROCEDURE test.proc_byrange;
DROP TABLE test.regular_tbl;
DROP TABLE test.byrange_tbl;
DROP TABLE test.t1;

View File

@@ -61,6 +61,34 @@ ROLLBACK;
SELECT * FROM t1 ORDER BY a;
a
1
SET @old_mode= @@SESSION.binlog_format;
SET SESSION binlog_format= row;
SET SESSION gtid_domain_id= 200;
CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
SET SESSION gtid_domain_id= 0;
BEGIN;
INSERT INTO t2 VALUES (200);
INSERT INTO t1 SELECT * FROM t2;
COMMIT;
SET SESSION gtid_domain_id= 201;
SET SESSION gtid_domain_id= 0;
DELETE FROM t1 WHERE a=200;
SET SESSION gtid_domain_id= 202;
DROP TEMPORARY TABLE t2;
SET SESSION binlog_format= mixed;
SET SESSION gtid_domain_id= 0;
CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1);
SET SESSION gtid_domain_id= 0;
SET SESSION gtid_domain_id= 204;
ERROR HY000: Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transaction
SET SESSION binlog_format=statement;
INSERT INTO t2 VALUES (2);
SET SESSION gtid_domain_id= 205;
ERROR HY000: Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transaction
DROP TEMPORARY TABLE t2;
SET SESSION gtid_domain_id= @old_domain;
SET SESSION binlog_format= @old_mode;
*** Test requesting an explicit GTID position that conflicts with newer GTIDs of our own in the binlog. ***
connection slave;
include/stop_slave.inc
@@ -84,16 +112,16 @@ ERROR 25000: You are not allowed to execute this command in a transaction
ROLLBACK;
SET GLOBAL gtid_strict_mode= 1;
SET GLOBAL gtid_slave_pos = "0-1-1";
ERROR HY000: Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
ERROR HY000: Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-18. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
SET GLOBAL gtid_slave_pos = "";
ERROR HY000: Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
ERROR HY000: Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-18. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
SET GLOBAL gtid_strict_mode= 0;
SET GLOBAL gtid_slave_pos = "0-1-1";
Warnings:
Warning 1947 Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
Warning 1947 Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-18. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
SET GLOBAL gtid_slave_pos = "";
Warnings:
Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-18. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
RESET MASTER;
SET GLOBAL gtid_slave_pos = "0-1-1";
START SLAVE;

View File

@@ -140,8 +140,26 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
*** MDEV-5798: Wrong errorcode for missing partition after TRUNCATE PARTITION
connection master;
CREATE TABLE t1 (a INT)
ENGINE='Archive'
PARTITION BY LIST(a) (
PARTITION p0 VALUES IN (9, NULL),
PARTITION p1 VALUES IN (8, 2, 7),
PARTITION p2 VALUES IN (6, 4, 5),
PARTITION p3 VALUES IN (3, 1, 0)
);
ALTER TABLE t1 DROP PARTITION p0;
ALTER TABLE non_existent TRUNCATE PARTITION p1,p2;
ERROR 42S02: Table 'test.non_existent' doesn't exist
INSERT INTO t1 PARTITION (p1,p2,p3) VALUES (0),(9);
ERROR HY000: Table has no partition for value 9
connection slave;
connection master;
DROP PROCEDURE test.proc_norm;
DROP PROCEDURE test.proc_byrange;
DROP TABLE test.regular_tbl;
DROP TABLE test.byrange_tbl;
DROP TABLE test.t1;
include/rpl_end.inc

View File

@@ -142,9 +142,26 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
*** MDEV-5798: Wrong errorcode for missing partition after TRUNCATE PARTITION
connection master;
CREATE TABLE t1 (a INT)
ENGINE='InnoDB'
PARTITION BY LIST(a) (
PARTITION p0 VALUES IN (9, NULL),
PARTITION p1 VALUES IN (8, 2, 7),
PARTITION p2 VALUES IN (6, 4, 5),
PARTITION p3 VALUES IN (3, 1, 0)
);
ALTER TABLE t1 DROP PARTITION p0;
ALTER TABLE non_existent TRUNCATE PARTITION p1,p2;
ERROR 42S02: Table 'test.non_existent' doesn't exist
INSERT INTO t1 PARTITION (p1,p2,p3) VALUES (0),(9);
ERROR HY000: Table has no partition for value 9
connection slave;
connection master;
DROP PROCEDURE test.proc_norm;
DROP PROCEDURE test.proc_byrange;
DROP TABLE test.regular_tbl;
DROP TABLE test.byrange_tbl;
DROP TABLE test.t1;
include/rpl_end.inc

View File

@@ -142,9 +142,26 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
*** MDEV-5798: Wrong errorcode for missing partition after TRUNCATE PARTITION
connection master;
CREATE TABLE t1 (a INT)
ENGINE='Memory'
PARTITION BY LIST(a) (
PARTITION p0 VALUES IN (9, NULL),
PARTITION p1 VALUES IN (8, 2, 7),
PARTITION p2 VALUES IN (6, 4, 5),
PARTITION p3 VALUES IN (3, 1, 0)
);
ALTER TABLE t1 DROP PARTITION p0;
ALTER TABLE non_existent TRUNCATE PARTITION p1,p2;
ERROR 42S02: Table 'test.non_existent' doesn't exist
INSERT INTO t1 PARTITION (p1,p2,p3) VALUES (0),(9);
ERROR HY000: Table has no partition for value 9
connection slave;
connection master;
DROP PROCEDURE test.proc_norm;
DROP PROCEDURE test.proc_byrange;
DROP TABLE test.regular_tbl;
DROP TABLE test.byrange_tbl;
DROP TABLE test.t1;
include/rpl_end.inc

View File

@@ -142,9 +142,26 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
*** MDEV-5798: Wrong errorcode for missing partition after TRUNCATE PARTITION
connection master;
CREATE TABLE t1 (a INT)
ENGINE='MyISAM'
PARTITION BY LIST(a) (
PARTITION p0 VALUES IN (9, NULL),
PARTITION p1 VALUES IN (8, 2, 7),
PARTITION p2 VALUES IN (6, 4, 5),
PARTITION p3 VALUES IN (3, 1, 0)
);
ALTER TABLE t1 DROP PARTITION p0;
ALTER TABLE non_existent TRUNCATE PARTITION p1,p2;
ERROR 42S02: Table 'test.non_existent' doesn't exist
INSERT INTO t1 PARTITION (p1,p2,p3) VALUES (0),(9);
ERROR HY000: Table has no partition for value 9
connection slave;
connection master;
DROP PROCEDURE test.proc_norm;
DROP PROCEDURE test.proc_byrange;
DROP TABLE test.regular_tbl;
DROP TABLE test.byrange_tbl;
DROP TABLE test.t1;
include/rpl_end.inc

View File

@@ -69,6 +69,46 @@ SELECT * FROM t1 ORDER BY a;
ROLLBACK;
SELECT * FROM t1 ORDER BY a;
# MDEV-34049: Parallel access to temptable in different domain_id in parallel replication
#
# Temporary tables must be prevented from being accessed from multiple threads
# at the same time in parallel replication. Withon one domain_id, this is done
# by running wait_for_prior_commit() before accessing a temporary table. To
# prevent the same temporary table from being accessed in parallel from two
# domains in out-of-order parallel replication, an error must be raised on
# attempt to change the gtid_domain_id while temporary tables are in use in
# a session and binlogged. In row-based binlogging, temporary tables are not
# binlogged, so gtid_domain_id can be freely changed.
SET @old_mode= @@SESSION.binlog_format;
SET SESSION binlog_format= row;
SET SESSION gtid_domain_id= 200;
CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
SET SESSION gtid_domain_id= 0;
BEGIN;
INSERT INTO t2 VALUES (200);
INSERT INTO t1 SELECT * FROM t2;
COMMIT;
SET SESSION gtid_domain_id= 201;
SET SESSION gtid_domain_id= 0;
DELETE FROM t1 WHERE a=200;
SET SESSION gtid_domain_id= 202;
DROP TEMPORARY TABLE t2;
SET SESSION binlog_format= mixed;
SET SESSION gtid_domain_id= 0;
CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1);
SET SESSION gtid_domain_id= 0;
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
SET SESSION gtid_domain_id= 204;
SET SESSION binlog_format=statement;
INSERT INTO t2 VALUES (2);
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
SET SESSION gtid_domain_id= 205;
DROP TEMPORARY TABLE t2;
SET SESSION gtid_domain_id= @old_domain;
SET SESSION binlog_format= @old_mode;
--echo *** Test requesting an explicit GTID position that conflicts with newer GTIDs of our own in the binlog. ***
--connection slave