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

Merge 10.11 into 11.4

This commit is contained in:
Marko Mäkelä
2025-01-09 07:58:08 +02:00
473 changed files with 4731 additions and 3149 deletions

View File

@@ -26,7 +26,6 @@ RESET MASTER;
SET @@global.debug_dbug="d,error_unique_log_filename";
FLUSH LOGS;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
# assert: must show one binlog
show binary logs;
Log_name File_size
@@ -52,7 +51,6 @@ RESET MASTER;
SET @@global.debug_dbug="d,error_unique_log_filename";
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
# assert: must show one entry
SELECT count(*) FROM t2;
count(*)
@@ -78,7 +76,6 @@ LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
INSERT INTO t2 VALUES ('muse');
COMMIT;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
# assert: must show three entries
SELECT count(*) FROM t2;
count(*)
@@ -95,7 +92,6 @@ count(*)
0
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
# assert: must show 1 entry
SELECT count(*) FROM t4;
count(*)
@@ -118,13 +114,10 @@ count(*)
0
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
# INFO: Count(*) Before Offending DELETEs
# assert: must show 1 entry
SELECT count(*) FROM t4;
@@ -136,10 +129,8 @@ count(*)
4
DELETE FROM t4;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
DELETE FROM t2;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
# INFO: Count(*) After Offending DELETEs
# assert: must show zero entries
SELECT count(*) FROM t4;

View File

@@ -178,7 +178,6 @@ SET @old_dbug= @@GLOBAL.debug_dbug;
SET debug_dbug= '+d,binlog_inject_new_name_error';
FLUSH LOGS;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
SET debug_dbug= @old_dbug;
INSERT INTO t4 VALUES (2);
connection slave;

View File

@@ -0,0 +1,56 @@
include/master-slave.inc
[connection master]
connection slave;
include/stop_slave.inc
connection master;
include/rpl_stop_server.inc [server_number=1]
include/rpl_start_server.inc [server_number=1]
connection slave;
CHANGE MASTER TO Master_log_file='master-bin.000001', Master_log_pos=4, Master_use_gtid=No;
START SLAVE IO_THREAD;
include/wait_for_slave_io_to_start.inc
START SLAVE UNTIL Master_log_file='master-bin.000001', Master_log_pos= 1178;
SELECT MASTER_POS_WAIT('master-bin.000001', 1178, 60);
MASTER_POS_WAIT('master-bin.000001', 1178, 60)
NULL
SELECT * FROM t1 ORDER BY a;
a b c
1 0
2 0 hulu
3 0 bulu
include/wait_for_slave_sql_to_stop.inc
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1594]
STOP SLAVE IO_THREAD;
include/wait_for_slave_io_to_stop.inc
CHANGE MASTER TO Master_log_file='master-bin.000001', Master_log_pos=2297;
Warnings:
Note 4190 CHANGE MASTER TO is implicitly changing the value of 'Using_Gtid' from 'No' to 'No'
START SLAVE IO_THREAD;
START SLAVE SQL_THREAD;
include/wait_for_slave_io_to_start.inc
include/wait_for_slave_sql_error.inc [errno=1594]
SELECT * FROM t1 ORDER BY a;
a b c
1 0
2 0 hulu
3 0 bulu
4 0 skip
5 0 after compressed
SELECT * FROM t2 ORDER BY a;
a b
1 {"a": "hulu", "b": "[zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy][zyzzy]", "c": "bulu"}
STOP SLAVE IO_THREAD;
include/wait_for_slave_io_to_stop.inc
CHANGE MASTER TO Master_log_file='master-bin.000002', Master_log_pos=4;
Warnings:
Note 4190 CHANGE MASTER TO is implicitly changing the value of 'Using_Gtid' from 'No' to 'No'
START SLAVE IO_THREAD;
START SLAVE SQL_THREAD;
include/wait_for_slave_io_to_start.inc
include/wait_for_slave_sql_to_start.inc
DROP TABLE t1, t2;
CALL mtr.add_suppression('TRANSACTION_PAYLOAD_EVENT event. You can avoid this event by specifying');
CALL mtr.add_suppression('PARTIAL_UPDATE_ROWS_EVENT event. You can avoid this event by specifying');
connection master;
include/rpl_end.inc

View File

@@ -36,9 +36,9 @@ Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
FLUSH LOGS;
FOUND 1 /GTID 0-1-8 ddl/ in mysqlbinlog.out
FOUND 1 /GTID 0-1-9 ddl/ in mysqlbinlog.out
FOUND 1 /GTID 0-1-10 ddl/ in mysqlbinlog.out
FOUND 1 /GTID 0-1-11 ddl/ in mysqlbinlog.out
#
# Clean up
#
@@ -63,9 +63,9 @@ ALTER TABLE t1 REPAIR PARTITION p0;
Table Op Msg_type Msg_text
test.t1 repair status OK
FLUSH LOGS;
FOUND 1 /GTID 0-1-14 ddl/ in mysqlbinlog.out
FOUND 1 /GTID 0-1-15 ddl/ in mysqlbinlog.out
FOUND 1 /GTID 0-1-16 ddl/ in mysqlbinlog.out
FOUND 1 /GTID 0-1-17 ddl/ in mysqlbinlog.out
#
# Clean up
#

View File

@@ -32,6 +32,7 @@ insert into t1 set a = 2;
insert into t1 set a = 1;
include/save_master_gtid.inc
connection slave;
SET @@global.gtid_cleanup_batch_size = $val;
CHANGE MASTER TO master_use_gtid= no;
include/start_slave.inc
include/sync_with_master_gtid.inc
@@ -56,6 +57,7 @@ set statement sql_log_bin=0 for delete from mysql.gtid_slave_pos;
insert into mysql.gtid_slave_pos values (99 + 2, 1, 1, 1);
# 5.
include/rpl_restart_server.inc [server_number=2]
SET @@global.gtid_cleanup_batch_size = $val;
select * from mysql.gtid_slave_pos;
domain_id sub_id server_id seq_no
101 1 1 1
@@ -100,6 +102,7 @@ set statement sql_log_bin=0 for delete from mysql.gtid_slave_pos;
insert into mysql.gtid_slave_pos values (99 + 1, 1, 1, 1);
# 5.
include/rpl_restart_server.inc [server_number=2]
SET @@global.gtid_cleanup_batch_size = $val;
select * from mysql.gtid_slave_pos;
domain_id sub_id server_id seq_no
100 1 1 1
@@ -146,5 +149,6 @@ connection master;
DROP TABLE t1;
include/save_master_gtid.inc
connection slave;
SET @@global.gtid_cleanup_batch_size= $old_gtid_cleanup_batch_size;
include/sync_with_master_gtid.inc
include/rpl_end.inc

View File

@@ -0,0 +1,121 @@
--source include/have_innodb.inc
--source include/have_binlog_format_row.inc
--source include/master-slave.inc
# Test some replication events from MySQL 8.0 to MariaDB.
# Works by copying in a binlog generated by MySQL 8.0.
# The binlog was generated by the following test case. Note that after
# re-generating this, values for Master_log_pos below may need updating, check
# mysqlbinlog for the correct new values.
#
# The latin1 character set is needed since MariaDB currently does not support
# the default MySQL character set. The binlog_format=statement is needed due to
# missing support for the JSON type in row events. These can be removed once
# support is added in MariaDB.
#
# --source include/not_group_replication_plugin.inc
# --source include/have_binlog_format_row.inc
# --source include/master-slave.inc
#
# --connection master
# SET NAMES 'latin1';
# SET SESSION collation_server= 'latin1_swedish_ci';
# CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c VARCHAR(1024)) ENGINE=InnoDB CHARACTER SET latin1;
# INSERT INTO t1 VALUES (1, 0, '');
# BEGIN;
# INSERT INTO t1 VALUES (2, 0, 'hulu');
# INSERT INTO t1 VALUES (3, 0, 'bulu');
# COMMIT;
# INSERT INTO t1 VALUES (4, 0, 'skip');
#
# SET SESSION binlog_transaction_compression= 1;
# BEGIN;
# --disable_query_log
# --let $i= 0
# while ($i < 100) {
# eval INSERT INTO t1 VALUES ($i+1000, $i, CONCAT("--", $i, "--", REPEAT("\\/", 100), "--"));
# inc $i;
# }
# --enable_query_log
# COMMIT;
# SET SESSION binlog_transaction_compression= default;
#
# INSERT INTO t1 VALUES (5, 0, 'after compressed');
# SET SESSION binlog_row_value_options= PARTIAL_JSON;
# CREATE TABLE t2 (a INT PRIMARY KEY, b JSON) ENGINE=InnoDB;
# SET SESSION binlog_format=statement;
# INSERT INTO t2 VALUES (1, CONCAT('{"a": "hulu", "b": "', REPEAT("[zyzzy]", 100), '", "c": "bulu"}'));
# SET SESSION binlog_format=row;
# UPDATE t2 SET b=JSON_REPLACE(b, '$.b', REPEAT("oOo", 50));
# SET SESSION binlog_row_value_options= DEFAULT;
# --sync_slave_with_master
#
# --connection master
# SET sql_log_bin= 0;
# FLUSH BINARY LOGS;
# SET sql_log_bin= 1;
# DROP TABLE t1, t2;
# --source include/rpl_end.inc
--connection slave
--source include/stop_slave.inc
--connection master
--let $datadir= `SELECT @@datadir`
--let $rpl_server_number= 1
--source include/rpl_stop_server.inc
# Copy in the MySQL 8.0 generated binlog.
--remove_file $datadir/master-bin.000001
--copy_file $MYSQL_TEST_DIR/std_data/mdev35643_mysql_80_binlog.000001 $datadir/master-bin.000001
--source include/rpl_start_server.inc
--save_master_pos
--connection slave
CHANGE MASTER TO Master_log_file='master-bin.000001', Master_log_pos=4, Master_use_gtid=No;
START SLAVE IO_THREAD;
--source include/wait_for_slave_io_to_start.inc
# The position 1178 is the start of: INSERT INTO t1 VALUES (4, 0, 'skip');
# After that comes unknown MySQL 8.0 events, which we test error for below.
START SLAVE UNTIL Master_log_file='master-bin.000001', Master_log_pos= 1178;
SELECT MASTER_POS_WAIT('master-bin.000001', 1178, 60);
SELECT * FROM t1 ORDER BY a;
--source include/wait_for_slave_sql_to_stop.inc
START SLAVE;
--let $slave_sql_errno= 1594
--source include/wait_for_slave_sql_error.inc
STOP SLAVE IO_THREAD;
--source include/wait_for_slave_io_to_stop.inc
# The position 2298 is the start of: INSERT INTO t1 VALUES (5, 0, 'after compressed');
CHANGE MASTER TO Master_log_file='master-bin.000001', Master_log_pos=2297;
START SLAVE IO_THREAD;
START SLAVE SQL_THREAD;
--source include/wait_for_slave_io_to_start.inc
--let $slave_sql_errno= 1594
--source include/wait_for_slave_sql_error.inc
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
STOP SLAVE IO_THREAD;
--source include/wait_for_slave_io_to_stop.inc
# Restart replication after the MySQL 8.0 file.
CHANGE MASTER TO Master_log_file='master-bin.000002', Master_log_pos=4;
START SLAVE IO_THREAD;
START SLAVE SQL_THREAD;
--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_start.inc
--sync_with_master
DROP TABLE t1, t2;
CALL mtr.add_suppression('TRANSACTION_PAYLOAD_EVENT event. You can avoid this event by specifying');
CALL mtr.add_suppression('PARTIAL_UPDATE_ROWS_EVENT event. You can avoid this event by specifying');
--connection master
--source include/rpl_end.inc

View File

@@ -22,6 +22,10 @@
--let $rpl_topology=1->2
--source include/rpl_init.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--connection server_1
FLUSH TABLES;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;

View File

@@ -47,6 +47,12 @@ while ($i)
--source include/save_master_gtid.inc
--connection slave
# enforce determistic SELECT * from mysql.gtid_slave_pos
--let $old_gtid_cleanup_batch_size = `select @@GLOBAL.gtid_cleanup_batch_size`
# the number of generated transactions on master must not exceed this value:
--let $val= 2147483647
--evalp SET @@global.gtid_cleanup_batch_size = $val
# due to MDEV-19801 on 10+.10+
CHANGE MASTER TO master_use_gtid= no;
--source include/start_slave.inc
@@ -87,6 +93,7 @@ while ($i)
--echo # 5.
--let $rpl_server_number= 2
--source include/rpl_restart_server.inc
--evalp SET @@global.gtid_cleanup_batch_size = $val
select * from mysql.gtid_slave_pos;
select @@global.gtid_slave_pos as "before dump restore";
--let $dump=dump_$i.sql
@@ -132,6 +139,7 @@ DROP TABLE t1;
--source include/save_master_gtid.inc
--connection slave
--evalp SET @@global.gtid_cleanup_batch_size= $old_gtid_cleanup_batch_size
--remove_files_wildcard $MYSQLTEST_VARDIR/tmp dump_*.sql
--source include/sync_with_master_gtid.inc

View File

@@ -2,6 +2,9 @@
--source include/have_debug.inc
--source include/master-slave.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--echo MDEV-31655: Parallel replication deadlock victim preference code erroneously removed
# The problem was that InnoDB would choose the wrong deadlock victim.

View File

@@ -3,6 +3,10 @@
--source include/have_debug.inc
--source include/have_binlog_format_statement.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--connection master
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1(a INT) ENGINE=INNODB;

View File

@@ -5,6 +5,10 @@
--source include/have_debug_sync.inc
--source include/master-slave.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--connection server_2
SET sql_log_bin=0;
CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");

View File

@@ -7,6 +7,9 @@
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
call mtr.add_suppression("Can't find record in 't1'");
call mtr.add_suppression("Can't find record in 't2'");
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--connection server_1
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;

View File

@@ -3,6 +3,10 @@
--let $rpl_topology=1->2
--source include/rpl_init.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--connection server_1
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;

View File

@@ -9,6 +9,10 @@
--source include/have_perfschema.inc
--source include/master-slave.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--let $xid_num = 19
--let $repeat = 17
--let $workers = 7

View File

@@ -2,6 +2,9 @@
--source include/master-slave.inc
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
--disable_query_log
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
--enable_query_log
--echo *** Provoke a deadlock on the slave, check that transaction retry succeeds. ***
--connection master