diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-27 18:03:03 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-27 18:03:03 +0200 |
commit | e538cb095f6290c40e8928e3813db6ac679740a2 (patch) | |
tree | 51f12fad5a2928fc1d398e7f45fc40c1c09e2512 /mysql-test/suite/galera | |
parent | 356c149603285086d964c8a51107be97b981c15c (diff) | |
parent | 80459bcbd4ca2cfd149f58c41428882fcfc49e03 (diff) | |
download | mariadb-git-e538cb095f6290c40e8928e3813db6ac679740a2.tar.gz |
Merge 10.5 into 10.6
Diffstat (limited to 'mysql-test/suite/galera')
15 files changed, 280 insertions, 53 deletions
diff --git a/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc index 3ac52deb284..bd63a7fd1d8 100644 --- a/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc +++ b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc @@ -21,7 +21,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); INSERT INTO t1 VALUES ('node2_committed_before'); COMMIT; ---source suite/galera/include/galera_unload_provider.inc +--source suite/galera/include/galera_stop_replication.inc --connection node_1 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' @@ -53,7 +53,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); --connection node_2 ---source suite/galera/include/galera_load_provider.inc +--source suite/galera/include/galera_start_replication.inc # # client connections were killed by provider load, so have to re-open here diff --git a/mysql-test/suite/galera/include/galera_load_provider.inc b/mysql-test/suite/galera/include/galera_start_replication.inc index b9b201106d7..b9b201106d7 100644 --- a/mysql-test/suite/galera/include/galera_load_provider.inc +++ b/mysql-test/suite/galera/include/galera_start_replication.inc diff --git a/mysql-test/suite/galera/include/galera_unload_provider.inc b/mysql-test/suite/galera/include/galera_stop_replication.inc index ed7e9bc41f0..ed7e9bc41f0 100644 --- a/mysql-test/suite/galera/include/galera_unload_provider.inc +++ b/mysql-test/suite/galera/include/galera_stop_replication.inc diff --git a/mysql-test/suite/galera/r/galera_ctas.result b/mysql-test/suite/galera/r/galera_ctas.result new file mode 100644 index 00000000000..f044f807410 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_ctas.result @@ -0,0 +1,88 @@ +connection node_2; +connection node_1; +connection node_1; +create table t1_Aria(a int, count int, b int, key(b)) engine=Aria; +INSERT INTO t1_Aria values (1,1,1); +create table t1_MyISAM(a int, count int, b int, key(b)) engine=MyISAM; +INSERT INTO t1_MyISAM values (1,1,1); +create table t1_InnoDB(a int, count int, b int, key(b)) engine=InnoDB; +INSERT INTO t1_InnoDB values (1,1,1); +SET SESSION default_storage_engine=MyISAM; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2, t3,t4; +SET SESSION default_storage_engine=Aria; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +DROP TABLE t2, t3,t4; +SET SESSION default_storage_engine=InnoDB; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t2, t3,t4; +DROP TABLE t1_MyISAM, t1_Aria,t1_InnoDB; diff --git a/mysql-test/suite/galera/r/galera_ist_restart_joiner.result b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result index 80d2c90642b..7cb6d90840e 100644 --- a/mysql-test/suite/galera/r/galera_ist_restart_joiner.result +++ b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result @@ -5,8 +5,9 @@ connection node_2; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'),(6, 'a'); connection node_2; +SET SESSION wsrep_sync_wait=0; Unloading wsrep provider ... -SET GLOBAL wsrep_provider = 'none'; +SET GLOBAL wsrep_cluster_address = ''; connection node_1; UPDATE t1 SET f2 = 'b' WHERE f1 > 1; UPDATE t1 SET f2 = 'c' WHERE f1 > 2; diff --git a/mysql-test/suite/galera/r/galera_log_bin_opt.result b/mysql-test/suite/galera/r/galera_log_bin_opt.result new file mode 100644 index 00000000000..160575df412 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_log_bin_opt.result @@ -0,0 +1,80 @@ +connection node_2; +connection node_1; +connection node_1; +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; +connection node_2; +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (id INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1); +INSERT INTO t2 VALUES (1); +connection node_2; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 2 FROM t2; +COUNT(*) = 2 +1 +connection node_1; +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t1) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER +connection node_2; +SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +COUNT(*) = 2 +1 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t1) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER +DROP TABLE t1; +DROP TABLE t2; +#cleanup +connection node_1; +SET GLOBAL wsrep_on=OFF; +RESET MASTER; diff --git a/mysql-test/suite/galera/t/galera_ctas.test b/mysql-test/suite/galera/t/galera_ctas.test new file mode 100644 index 00000000000..8b9ad9c4a20 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_ctas.test @@ -0,0 +1,39 @@ +--source include/galera_cluster.inc + +--connection node_1 +create table t1_Aria(a int, count int, b int, key(b)) engine=Aria; +INSERT INTO t1_Aria values (1,1,1); +create table t1_MyISAM(a int, count int, b int, key(b)) engine=MyISAM; +INSERT INTO t1_MyISAM values (1,1,1); +create table t1_InnoDB(a int, count int, b int, key(b)) engine=InnoDB; +INSERT INTO t1_InnoDB values (1,1,1); + +SET SESSION default_storage_engine=MyISAM; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +SHOW CREATE TABLE t3; +SHOW CREATE TABLE t4; +DROP TABLE t2, t3,t4; + +SET SESSION default_storage_engine=Aria; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +SHOW CREATE TABLE t3; +SHOW CREATE TABLE t4; +DROP TABLE t2, t3,t4; + +SET SESSION default_storage_engine=InnoDB; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +SHOW CREATE TABLE t3; +SHOW CREATE TABLE t4; + +DROP TABLE t2, t3,t4; +DROP TABLE t1_MyISAM, t1_Aria,t1_InnoDB; + diff --git a/mysql-test/suite/galera/t/galera_gcache_recover.cnf b/mysql-test/suite/galera/t/galera_gcache_recover.cnf index c7b59b6a27e..34c757de77e 100644 --- a/mysql-test/suite/galera/t/galera_gcache_recover.cnf +++ b/mysql-test/suite/galera/t/galera_gcache_recover.cnf @@ -4,4 +4,4 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true' +wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes' diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test index 42f210170bc..f56d0e657bd 100644 --- a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test +++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test @@ -21,7 +21,8 @@ INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'),(6, 'a'); # Disconnect node #2 --connection node_2 ---source suite/galera/include/galera_unload_provider.inc +SET SESSION wsrep_sync_wait=0; +--source suite/galera/include/galera_stop_replication.inc --connection node_1 UPDATE t1 SET f2 = 'b' WHERE f1 > 1; @@ -43,7 +44,6 @@ UPDATE t1 SET f2 = 'c' WHERE f1 > 2; # ... and restart provider to force IST --echo Loading wsrep_provider ... --disable_query_log ---eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; # Make sure IST will block ... --let $galera_sync_point = recv_IST_after_apply_trx --source include/galera_set_sync_point.inc diff --git a/mysql-test/suite/galera/t/galera_log_bin.inc b/mysql-test/suite/galera/t/galera_log_bin.inc new file mode 100644 index 00000000000..cc78367b510 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_log_bin.inc @@ -0,0 +1,46 @@ +--source include/galera_cluster.inc +--source include/force_restart.inc + +--connection node_1 +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; +--connection node_2 +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; + +# +# Test Galera with --log-bin --log-slave-updates . +# This way the actual MySQL binary log is used, +# rather than Galera's own implementation +# + +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); + +CREATE TABLE t2 (id INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1); +INSERT INTO t2 VALUES (1); + +--connection node_2 +SELECT COUNT(*) = 1 FROM t1; +SELECT COUNT(*) = 2 FROM t2; + +--connection node_1 +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +--let $MASTER_MYPORT=$NODE_MYPORT_1 +--source include/show_binlog_events.inc + +--connection node_2 +SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +--let $MASTER_MYPORT=$NODE_MYPORT_2 +--source include/show_binlog_events.inc + +DROP TABLE t1; +DROP TABLE t2; + +--echo #cleanup +--connection node_1 +SET GLOBAL wsrep_on=OFF; +RESET MASTER; diff --git a/mysql-test/suite/galera/t/galera_log_bin.test b/mysql-test/suite/galera/t/galera_log_bin.test index cc78367b510..923bd623a8a 100644 --- a/mysql-test/suite/galera/t/galera_log_bin.test +++ b/mysql-test/suite/galera/t/galera_log_bin.test @@ -1,46 +1 @@ ---source include/galera_cluster.inc ---source include/force_restart.inc - ---connection node_1 -set global wsrep_on=OFF; -reset master; -set global wsrep_on=ON; ---connection node_2 -set global wsrep_on=OFF; -reset master; -set global wsrep_on=ON; - -# -# Test Galera with --log-bin --log-slave-updates . -# This way the actual MySQL binary log is used, -# rather than Galera's own implementation -# - -CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -INSERT INTO t1 VALUES (1); - -CREATE TABLE t2 (id INT) ENGINE=InnoDB; -INSERT INTO t2 VALUES (1); -INSERT INTO t2 VALUES (1); - ---connection node_2 -SELECT COUNT(*) = 1 FROM t1; -SELECT COUNT(*) = 2 FROM t2; - ---connection node_1 -ALTER TABLE t1 ADD COLUMN f2 INTEGER; ---let $MASTER_MYPORT=$NODE_MYPORT_1 ---source include/show_binlog_events.inc - ---connection node_2 -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ---let $MASTER_MYPORT=$NODE_MYPORT_2 ---source include/show_binlog_events.inc - -DROP TABLE t1; -DROP TABLE t2; - ---echo #cleanup ---connection node_1 -SET GLOBAL wsrep_on=OFF; -RESET MASTER; +--source galera_log_bin.inc diff --git a/mysql-test/suite/galera/t/galera_log_bin_opt-master.opt b/mysql-test/suite/galera/t/galera_log_bin_opt-master.opt new file mode 100644 index 00000000000..03fcb5d040d --- /dev/null +++ b/mysql-test/suite/galera/t/galera_log_bin_opt-master.opt @@ -0,0 +1 @@ +--log-slave-updates --log-bin diff --git a/mysql-test/suite/galera/t/galera_log_bin_opt.cnf b/mysql-test/suite/galera/t/galera_log_bin_opt.cnf new file mode 100644 index 00000000000..a09efd2e011 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_log_bin_opt.cnf @@ -0,0 +1,15 @@ +!include ../galera_2nodes.cnf + +[mysqld] +wsrep_sst_method=mariabackup +wsrep_sst_auth="root:" + +[mysqld.1] +wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' + +[mysqld.2] +wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' + +[sst] +transferfmt=@ENV.MTR_GALERA_TFMT +streamfmt=xbstream diff --git a/mysql-test/suite/galera/t/galera_log_bin_opt.test b/mysql-test/suite/galera/t/galera_log_bin_opt.test new file mode 100644 index 00000000000..f3d0afbc8bc --- /dev/null +++ b/mysql-test/suite/galera/t/galera_log_bin_opt.test @@ -0,0 +1,2 @@ +--source include/have_mariabackup.inc +--source galera_log_bin.inc diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.test b/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.test index d1c30656139..e8dcbd849d8 100644 --- a/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.test +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.test @@ -10,7 +10,7 @@ --connection node_2 #--connection node_2 -#--source suite/galera/include/galera_unload_provider.inc +#--source suite/galera/include/galera_stop_replication.inc --echo Shutting down server ... --source include/shutdown_mysqld.inc |