diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake index b2b2eef9245..b4936ff57cc 100644 --- a/cmake/maintainer.cmake +++ b/cmake/maintainer.cmake @@ -23,6 +23,8 @@ ENDIF() SET(MY_WARNING_FLAGS -Wall -Wdeclaration-after-statement + -Wenum-compare + -Wenum-conversion -Wextra -Wformat-security -Wno-format-truncation diff --git a/mysql-test/include/have_log_bin.inc b/mysql-test/include/have_log_bin.inc index eb2529dae3b..fd5dc66e416 100644 --- a/mysql-test/include/have_log_bin.inc +++ b/mysql-test/include/have_log_bin.inc @@ -8,7 +8,6 @@ source include/not_embedded.inc; --- require include/have_log_bin.require -disable_query_log; -show variables like 'log_bin'; -enable_query_log; +if (`select not @@log_bin`) { + skip Test requires: 'have_log_bin'; +} diff --git a/mysql-test/include/have_log_bin.require b/mysql-test/include/have_log_bin.require deleted file mode 100644 index d4fd77e4f8d..00000000000 --- a/mysql-test/include/have_log_bin.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -log_bin ON diff --git a/mysql-test/main/insert.result b/mysql-test/main/insert.result index 674223c17a4..22682e180c6 100644 --- a/mysql-test/main/insert.result +++ b/mysql-test/main/insert.result @@ -776,6 +776,14 @@ select 1 in (select count(*) from t t1 join (t t2 join t t3 on (t1.a != 0))); ERROR 42S22: Unknown column 't1.a' in 'on clause' drop table t; # +# MDEV-28578 Server crashes in Item_field::fix_outer_field after CREATE SELECT +# +create table t1 (i int) ; +create table t2 (j int) ; +create table t4 select * from t1 join t2 on (select t3.i); +ERROR 42S22: Unknown column 't3.i' in 'field list' +drop table t1, t2; +# # End of 10.4 tests # # diff --git a/mysql-test/main/insert.test b/mysql-test/main/insert.test index 44da0d860f2..e5cb2bac6f8 100644 --- a/mysql-test/main/insert.test +++ b/mysql-test/main/insert.test @@ -640,6 +640,15 @@ create table t (a int); select 1 in (select count(*) from t t1 join (t t2 join t t3 on (t1.a != 0))); drop table t; +--echo # +--echo # MDEV-28578 Server crashes in Item_field::fix_outer_field after CREATE SELECT +--echo # +create table t1 (i int) ; +create table t2 (j int) ; +--error ER_BAD_FIELD_ERROR +create table t4 select * from t1 join t2 on (select t3.i); +drop table t1, t2; + --echo # --echo # End of 10.4 tests --echo # @@ -660,4 +669,3 @@ drop table t1; --echo # --echo # End of 10.5 tests --echo # - diff --git a/mysql-test/suite/compat/oracle/r/events.result b/mysql-test/suite/compat/oracle/r/events.result index ef9c50115ae..1f62e2e5ee2 100644 --- a/mysql-test/suite/compat/oracle/r/events.result +++ b/mysql-test/suite/compat/oracle/r/events.result @@ -16,3 +16,12 @@ COUNT(*) 1 DROP TABLE t1; SET GLOBAL event_scheduler=off; +# +# MDEV-28588 SIGSEGV in __memmove_avx_unaligned_erms, strmake_root +# +CREATE EVENT ev ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO BEGIN END; +Warnings: +Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it. +SELECT EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='test' AND EVENT_NAME='ev'; +EVENT_DEFINITION BEGIN END +DROP EVENT ev; diff --git a/mysql-test/suite/compat/oracle/r/sp.result b/mysql-test/suite/compat/oracle/r/sp.result index 824207ef4c1..961872d5746 100644 --- a/mysql-test/suite/compat/oracle/r/sp.result +++ b/mysql-test/suite/compat/oracle/r/sp.result @@ -2549,7 +2549,18 @@ idx 1 DROP PROCEDURE p1; # -# Start of 10.4 tests +# MDEV-28588 SIGSEGV in __memmove_avx_unaligned_erms, strmake_root +# +SET sql_mode=ORACLE; +BEGIN END; +CREATE TABLE t1 (a INT); +CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW BEGIN END; +SELECT ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA='test' AND TRIGGER_NAME='tr'; +ACTION_STATEMENT BEGIN END +DROP TRIGGER tr; +DROP TABLE t1; +# +# End of 10.3 tests # # # MDEV-19637 Crash on an SP variable assignment to a wrong subselect diff --git a/mysql-test/suite/compat/oracle/t/events.test b/mysql-test/suite/compat/oracle/t/events.test index e898528636a..fb56af51d87 100644 --- a/mysql-test/suite/compat/oracle/t/events.test +++ b/mysql-test/suite/compat/oracle/t/events.test @@ -25,5 +25,13 @@ let $wait_condition = SELECT COUNT(*) FROM t1; DROP TABLE t1; - SET GLOBAL event_scheduler=off; + +--echo # +--echo # MDEV-28588 SIGSEGV in __memmove_avx_unaligned_erms, strmake_root +--echo # +CREATE EVENT ev ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO BEGIN END; +--vertical_results +SELECT EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='test' AND EVENT_NAME='ev'; +--horizontal_results +DROP EVENT ev; diff --git a/mysql-test/suite/compat/oracle/t/sp.test b/mysql-test/suite/compat/oracle/t/sp.test index 99bdc7166e0..69b8608b19a 100644 --- a/mysql-test/suite/compat/oracle/t/sp.test +++ b/mysql-test/suite/compat/oracle/t/sp.test @@ -2392,9 +2392,23 @@ DROP PROCEDURE p1; --echo # ---echo # Start of 10.4 tests +--echo # MDEV-28588 SIGSEGV in __memmove_avx_unaligned_erms, strmake_root --echo # +SET sql_mode=ORACLE; +BEGIN END; + +CREATE TABLE t1 (a INT); +CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW BEGIN END; +--vertical_results +SELECT ACTION_STATEMENT FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA='test' AND TRIGGER_NAME='tr'; +--horizontal_results +DROP TRIGGER tr; +DROP TABLE t1; + +--echo # +--echo # End of 10.3 tests +--echo # --echo # --echo # MDEV-19637 Crash on an SP variable assignment to a wrong subselect diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 4099caad3b3..35e8a3c725e 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -19,10 +19,8 @@ galera_bf_abort_group_commit : MDEV-18282 Galera test failure on galera.galera_b galera_bf_kill_debug : MDEV-24485 wsrep::client_state::do_acquire_ownership(): Assertion `state_ == s_idle || mode_ != m_local' failed galera_bf_lock_wait : MDEV-21597 wsrep::transaction::start_transaction(): Assertion `active() == false' failed galera_encrypt_tmp_files : Get error failed to enable encryption of temporary files -galera_ftwrl : MDEV-21525 galera.galera_ftwrl galera_gcache_recover_manytrx : MDEV-18834 Galera test failure galera_kill_largechanges : MDEV-18179 Galera test failure on galera.galera_kill_largechanges -galera_many_tables_nopk : MDEV-18182 Galera test failure on galera.galera_many_tables_nopk galera_mdl_race : MDEV-21524 galera.galera_mdl_race galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails galera_pc_ignore_sb : MDEV-20888 galera.galera_pc_ignore_sb diff --git a/mysql-test/suite/galera/r/MDEV-28053.result b/mysql-test/suite/galera/r/MDEV-28053.result new file mode 100644 index 00000000000..b3f93688dd0 --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-28053.result @@ -0,0 +1,14 @@ +connection node_2; +connection node_1; +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connection node_3; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +connection node_2; +connection node_3; +DROP TABLE t1; +connection node_2; +connection node_2; +STOP SLAVE; +RESET SLAVE ALL; +connection node_3; +RESET MASTER; diff --git a/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result b/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result index 8d0734f9df8..4fe33674701 100644 --- a/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result +++ b/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result @@ -1,33 +1,44 @@ connection node_2; connection node_1; connection node_1; +SET GLOBAL auto_increment_offset=1; +connection node_2; +SET GLOBAL auto_increment_offset=2; +connection node_1; connection node_2; connection node_2; SET GLOBAL wsrep_forced_binlog_format='STATEMENT'; connection node_1; SET GLOBAL wsrep_forced_binlog_format='STATEMENT'; CREATE TABLE t1 ( -i int(11) NOT NULL AUTO_INCREMENT, -c char(32) DEFAULT 'dummy_text', -PRIMARY KEY (i) +i int(11) NOT NULL primary key AUTO_INCREMENT, +c char(32) DEFAULT 'dummy_text' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +show variables like 'auto_increment%'; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 1 insert into t1(i) values(null); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave -select * from t1; +select * from t1 order by i; i c 1 dummy_text insert into t1(i) values(null), (null), (null); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave -select * from t1; +select * from t1 order by i; i c 1 dummy_text 3 dummy_text 5 dummy_text 7 dummy_text connection node_2; -select * from t1; +show variables like 'auto_increment%'; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 2 +select * from t1 order by i; i c 1 dummy_text 3 dummy_text @@ -45,27 +56,34 @@ SET GLOBAL wsrep_auto_increment_control='OFF'; SET SESSION auto_increment_increment = 3; SET SESSION auto_increment_offset = 1; CREATE TABLE t1 ( -i int(11) NOT NULL AUTO_INCREMENT, -c char(32) DEFAULT 'dummy_text', -PRIMARY KEY (i) +i int(11) NOT NULL primary key AUTO_INCREMENT, +c char(32) DEFAULT 'dummy_text' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +show variables like 'auto_increment%'; +Variable_name Value +auto_increment_increment 3 +auto_increment_offset 1 insert into t1(i) values(null); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave -select * from t1; +select * from t1 order by i; i c 1 dummy_text insert into t1(i) values(null), (null), (null); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave -select * from t1; +select * from t1 order by i; i c 1 dummy_text 4 dummy_text 7 dummy_text 10 dummy_text connection node_2; -select * from t1; +show variables like 'auto_increment%'; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 2 +select * from t1 order by i; i c 1 dummy_text 4 dummy_text @@ -74,6 +92,7 @@ i c connection node_1; SET GLOBAL wsrep_auto_increment_control='ON'; SET SESSION binlog_format='ROW'; +connection node_1; show variables like 'binlog_format'; Variable_name Value binlog_format ROW @@ -89,29 +108,37 @@ auto_increment_increment 3 auto_increment_offset 1 wsrep_auto_increment_control OFF SET GLOBAL wsrep_auto_increment_control='ON'; +connection node_1; drop table t1; connection node_2; SET GLOBAL wsrep_forced_binlog_format='ROW'; connection node_1; SET GLOBAL wsrep_forced_binlog_format='ROW'; CREATE TABLE t1 ( -i int(11) NOT NULL AUTO_INCREMENT, -c char(32) DEFAULT 'dummy_text', -PRIMARY KEY (i) +i int(11) NOT NULL primary key AUTO_INCREMENT, +c char(32) DEFAULT 'dummy_text' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +show variables like 'auto_increment%'; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 1 insert into t1(i) values(null); -select * from t1; +select * from t1 order by i; i c 1 dummy_text insert into t1(i) values(null), (null), (null); -select * from t1; +select * from t1 order by i; i c 1 dummy_text 3 dummy_text 5 dummy_text 7 dummy_text connection node_2; -select * from t1; +show variables like 'auto_increment%'; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 2 +select * from t1 order by i; i c 1 dummy_text 3 dummy_text @@ -129,23 +156,30 @@ SET GLOBAL wsrep_auto_increment_control='OFF'; SET SESSION auto_increment_increment = 3; SET SESSION auto_increment_offset = 1; CREATE TABLE t1 ( -i int(11) NOT NULL AUTO_INCREMENT, -c char(32) DEFAULT 'dummy_text', -PRIMARY KEY (i) +i int(11) NOT NULL primary key AUTO_INCREMENT, +c char(32) DEFAULT 'dummy_text' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +show variables like 'auto_increment%'; +Variable_name Value +auto_increment_increment 3 +auto_increment_offset 1 insert into t1(i) values(null); -select * from t1; +select * from t1 order by i; i c 1 dummy_text insert into t1(i) values(null), (null), (null); -select * from t1; +select * from t1 order by i; i c 1 dummy_text 4 dummy_text 7 dummy_text 10 dummy_text connection node_2; -select * from t1; +show variables like 'auto_increment%'; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 2 +select * from t1 order by i; i c 1 dummy_text 4 dummy_text @@ -159,13 +193,13 @@ binlog_format ROW show variables like '%auto_increment%'; Variable_name Value auto_increment_increment 2 -auto_increment_offset 1 +auto_increment_offset 2 wsrep_auto_increment_control ON SET GLOBAL wsrep_auto_increment_control='OFF'; show variables like '%auto_increment%'; Variable_name Value -auto_increment_increment 3 -auto_increment_offset 1 +auto_increment_increment 1 +auto_increment_offset 2 wsrep_auto_increment_control OFF SET GLOBAL wsrep_auto_increment_control='ON'; drop table t1; diff --git a/mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff new file mode 100644 index 00000000000..8c84321e774 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff @@ -0,0 +1,190 @@ +--- r/galera_ist_MDEV-28423.result ++++ r/galera_ist_MDEV-28423,debug.reject +@@ -517,3 +517,187 @@ + 1 + DROP TABLE t1; + COMMIT; ++Performing State Transfer on a server that has been killed and restarted ++while a DDL was in progress on it ++connection node_1; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); ++connection node_2; ++START TRANSACTION; ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); ++COMMIT; ++SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; ++connection node_1; ++ALTER TABLE t1 ADD COLUMN f2 INTEGER; ++connection node_2; ++SET wsrep_sync_wait = 0; ++Killing server ... ++connection node_1; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); ++COMMIT; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); ++connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); ++connection node_2; ++Performing --wsrep-recover ... ++connection node_2; ++Starting server ... ++Using --wsrep-start-position when starting mysqld ... ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); ++COMMIT; ++connection node_1; ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); ++COMMIT; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); ++COMMIT; ++connection node_1a_galera_st_kill_slave_ddl; ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); ++ROLLBACK; ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL ++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; ++COUNT(*) = 0 ++1 ++COMMIT; ++connection node_1; ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL ++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; ++COUNT(*) = 0 ++1 ++DROP TABLE t1; ++COMMIT; ++SET GLOBAL debug_dbug = $debug_orig; diff --git a/mysql-test/suite/galera/r/galera_ist_MDEV-28423.result b/mysql-test/suite/galera/r/galera_ist_MDEV-28423.result new file mode 100644 index 00000000000..5a71b490a80 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_ist_MDEV-28423.result @@ -0,0 +1,519 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +Performing State Transfer on a server that has been temporarily disconnected +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Unloading wsrep provider ... +SET GLOBAL wsrep_cluster_address = ''; +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Loading wsrep provider ... +disconnect node_2; +connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_disconnect_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; +Performing State Transfer on a server that has been shut down cleanly and restarted +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Shutting down server ... +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Starting server ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_shutdown_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; +Performing State Transfer on a server that has been killed and restarted +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Killing server ... +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +Starting server ... +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; diff --git a/mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff new file mode 100644 index 00000000000..51d2a6bf157 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff @@ -0,0 +1,190 @@ +--- r/galera_ist_MDEV-28583.result ++++ r/galera_ist_MDEV-28583,debug.reject +@@ -517,3 +517,187 @@ + 1 + DROP TABLE t1; + COMMIT; ++Performing State Transfer on a server that has been killed and restarted ++while a DDL was in progress on it ++connection node_1; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); ++connection node_2; ++START TRANSACTION; ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); ++COMMIT; ++SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; ++connection node_1; ++ALTER TABLE t1 ADD COLUMN f2 INTEGER; ++connection node_2; ++SET wsrep_sync_wait = 0; ++Killing server ... ++connection node_1; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); ++COMMIT; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); ++connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); ++connection node_2; ++Performing --wsrep-recover ... ++connection node_2; ++Starting server ... ++Using --wsrep-start-position when starting mysqld ... ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); ++COMMIT; ++connection node_1; ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); ++COMMIT; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); ++COMMIT; ++connection node_1a_galera_st_kill_slave_ddl; ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); ++ROLLBACK; ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL ++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; ++COUNT(*) = 0 ++1 ++COMMIT; ++connection node_1; ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL ++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; ++COUNT(*) = 0 ++1 ++DROP TABLE t1; ++COMMIT; ++SET GLOBAL debug_dbug = $debug_orig; diff --git a/mysql-test/suite/galera/r/galera_ist_MDEV-28583.result b/mysql-test/suite/galera/r/galera_ist_MDEV-28583.result new file mode 100644 index 00000000000..5a71b490a80 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_ist_MDEV-28583.result @@ -0,0 +1,519 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +Performing State Transfer on a server that has been temporarily disconnected +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Unloading wsrep provider ... +SET GLOBAL wsrep_cluster_address = ''; +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Loading wsrep provider ... +disconnect node_2; +connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_disconnect_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; +Performing State Transfer on a server that has been shut down cleanly and restarted +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Shutting down server ... +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Starting server ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_shutdown_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; +Performing State Transfer on a server that has been killed and restarted +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Killing server ... +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +Starting server ... +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; diff --git a/mysql-test/suite/galera/r/galera_many_tables_nopk.result b/mysql-test/suite/galera/r/galera_many_tables_nopk.result index 2a226defcc7..d341a1816e5 100644 --- a/mysql-test/suite/galera/r/galera_many_tables_nopk.result +++ b/mysql-test/suite/galera/r/galera_many_tables_nopk.result @@ -6,8 +6,8 @@ START TRANSACTION; COMMIT; connection node_2; CREATE TABLE sum_table (f1 INTEGER); -SELECT SUM(f1) = 900 FROM sum_table; -SUM(f1) = 900 +SELECT SUM(f1) = 100 FROM sum_table; +SUM(f1) = 100 1 connection node_1; SET AUTOCOMMIT=OFF; @@ -15,7 +15,7 @@ START TRANSACTION; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -UPDATE t900 SET f1 = 3; +UPDATE t100 SET f1 = 3; connection node_1; COMMIT; connection node_2; diff --git a/mysql-test/suite/galera/r/galera_read_only.result b/mysql-test/suite/galera/r/galera_read_only.result index fe8b45fa596..e7e18ca8145 100644 --- a/mysql-test/suite/galera/r/galera_read_only.result +++ b/mysql-test/suite/galera/r/galera_read_only.result @@ -17,10 +17,18 @@ connect foo_node_2,127.0.0.1,foo,,test,$port_2,; connection foo_node_2; INSERT INTO t1 VALUES (2); ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement +CREATE TEMPORARY TABLE t2(id int not null primary key) engine=innodb; +INSERT INTO t2 values (1); +DROP TABLE t2; connection node_2; -SELECT COUNT(*) = 1 FROM t1; -COUNT(*) = 1 +SELECT COUNT(*) AS EXPECT_1 FROM t1; +EXPECT_1 1 +connection node_2; +SET GLOBAL read_only=TRUE; +CREATE TEMPORARY TABLE t2(id int not null primary key) engine=innodb; +INSERT INTO t2 values (1); +DROP TABLE t2; SET GLOBAL read_only=FALSE; DROP TABLE t1; DROP USER foo@localhost; diff --git a/mysql-test/suite/galera/t/MDEV-28053.cnf b/mysql-test/suite/galera/t/MDEV-28053.cnf new file mode 100644 index 00000000000..2a500639d1d --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-28053.cnf @@ -0,0 +1,6 @@ +!include ../galera_2nodes_as_slave.cnf + +[mysqld] +slave_parallel_threads=4 +slave_parallel_mode=optimistic +gtid_strict_mode=1 diff --git a/mysql-test/suite/galera/t/MDEV-28053.test b/mysql-test/suite/galera/t/MDEV-28053.test new file mode 100644 index 00000000000..85cb20c7e10 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-28053.test @@ -0,0 +1,61 @@ +# +# MDEV-28053 - Sysbench data load crashes Galera secondary node in +# async master slave setup +# +# Setup: node 3 is a regular MariaDB server, nodes 1 and 2 are members +# of a Galera cluster. Node 2 connects to node 3 through async replication. +# +# Test uses multiple parallel async applier threads (see MDEV-28053.cnf) +# + +--source include/have_innodb.inc +--source include/galera_cluster.inc + +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 + +--connection node_3 +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; + +# +# Execute a few INSERTs, to simulate sysbench data load phase +# +--let $counter=100 +--disable_query_log +while ($counter) { + --connection node_3 + INSERT INTO t1 VALUES(); + --dec $counter +} +--enable_query_log +--let gtid = `SELECT @@last_gtid` + +# +# Start async replication on node 2. +# If bug is present, expect a crash when applying +# events concurrently. +# +--connection node_2 +--disable_query_log +--disable_result_log +--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3; +START SLAVE; +--eval SELECT MASTER_GTID_WAIT('$gtid', 600) +--enable_result_log +--enable_query_log + +# +# Cleanup +# +--connection node_3 +DROP TABLE t1; + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; +--source include/wait_condition.inc + +--connection node_2 +STOP SLAVE; +RESET SLAVE ALL; + +--connection node_3 +RESET MASTER; diff --git a/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf index 889c81b4a0a..91e9199b092 100644 --- a/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf +++ b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf @@ -2,6 +2,8 @@ [mysqld.1] auto_increment_offset=1 +auto_increment_increment=1 [mysqld.2] auto_increment_offset=2 +auto_increment_increment=1 diff --git a/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test index 431fa90c8e2..994f7695fc6 100644 --- a/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test +++ b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test @@ -3,7 +3,12 @@ ## --source include/galera_cluster.inc ---source include/have_innodb.inc +--source include/force_restart.inc + +--connection node_1 +SET GLOBAL auto_increment_offset=1; +--connection node_2 +SET GLOBAL auto_increment_offset=2; --let $node_1=node_1 --let $node_2=node_2 @@ -30,23 +35,24 @@ call mtr.add_suppression("Unsafe statement written to the binary log"); --enable_query_log CREATE TABLE t1 ( - i int(11) NOT NULL AUTO_INCREMENT, - c char(32) DEFAULT 'dummy_text', - PRIMARY KEY (i) + i int(11) NOT NULL primary key AUTO_INCREMENT, + c char(32) DEFAULT 'dummy_text' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +show variables like 'auto_increment%'; insert into t1(i) values(null); -select * from t1; +select * from t1 order by i; insert into t1(i) values(null), (null), (null); -select * from t1; +select * from t1 order by i; --connection node_2 --let $wait_condition = SELECT COUNT(*) = 4 FROM t1; --source include/wait_condition.inc -select * from t1; +show variables like 'auto_increment%'; +select * from t1 order by i; SET GLOBAL wsrep_forced_binlog_format='none'; @@ -80,36 +86,31 @@ SET SESSION auto_increment_increment = 3; SET SESSION auto_increment_offset = 1; CREATE TABLE t1 ( - i int(11) NOT NULL AUTO_INCREMENT, - c char(32) DEFAULT 'dummy_text', - PRIMARY KEY (i) + i int(11) NOT NULL primary key AUTO_INCREMENT, + c char(32) DEFAULT 'dummy_text' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +show variables like 'auto_increment%'; insert into t1(i) values(null); -select * from t1; +select * from t1 order by i; insert into t1(i) values(null), (null), (null); -select * from t1; +select * from t1 order by i; --connection node_2 --let $wait_condition = SELECT COUNT(*) = 4 FROM t1; --source include/wait_condition.inc +show variables like 'auto_increment%'; -select * from t1; +select * from t1 order by i; --connection node_1 - -## -## Verify the return to automatic calculation of the step -## and offset of the auto-increment: -## - SET GLOBAL wsrep_auto_increment_control='ON'; - SET SESSION binlog_format='ROW'; - +--source include/auto_increment_offset_restore.inc +--connection node_1 show variables like 'binlog_format'; show variables like '%auto_increment%'; @@ -127,7 +128,8 @@ show variables like '%auto_increment%'; ## SET GLOBAL wsrep_auto_increment_control='ON'; - +--source include/auto_increment_offset_restore.inc +--connection node_1 drop table t1; ## @@ -142,24 +144,25 @@ SET GLOBAL wsrep_forced_binlog_format='ROW'; SET GLOBAL wsrep_forced_binlog_format='ROW'; CREATE TABLE t1 ( - i int(11) NOT NULL AUTO_INCREMENT, - c char(32) DEFAULT 'dummy_text', - PRIMARY KEY (i) + i int(11) NOT NULL primary key AUTO_INCREMENT, + c char(32) DEFAULT 'dummy_text' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +show variables like 'auto_increment%'; insert into t1(i) values(null); -select * from t1; +select * from t1 order by i; insert into t1(i) values(null), (null), (null); -select * from t1; +select * from t1 order by i; --connection node_2 --let $wait_condition = SELECT COUNT(*) = 4 FROM t1; --source include/wait_condition.inc -select * from t1; +show variables like 'auto_increment%'; +select * from t1 order by i; SET GLOBAL wsrep_forced_binlog_format='none'; @@ -189,24 +192,25 @@ SET SESSION auto_increment_increment = 3; SET SESSION auto_increment_offset = 1; CREATE TABLE t1 ( - i int(11) NOT NULL AUTO_INCREMENT, - c char(32) DEFAULT 'dummy_text', - PRIMARY KEY (i) + i int(11) NOT NULL primary key AUTO_INCREMENT, + c char(32) DEFAULT 'dummy_text' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +show variables like 'auto_increment%'; insert into t1(i) values(null); -select * from t1; +select * from t1 order by i; insert into t1(i) values(null), (null), (null); -select * from t1; +select * from t1 order by i; --connection node_2 --let $wait_condition = SELECT COUNT(*) = 4 FROM t1; --source include/wait_condition.inc +show variables like 'auto_increment%'; -select * from t1; +select * from t1 order by i; --connection node_1 @@ -216,6 +220,7 @@ select * from t1; ## SET GLOBAL wsrep_auto_increment_control='ON'; +--source include/auto_increment_offset_restore.inc show variables like 'binlog_format'; show variables like '%auto_increment%'; diff --git a/mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf b/mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf new file mode 100644 index 00000000000..691e52208b1 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf @@ -0,0 +1,44 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +# server-id=101 +#wsrep-debug=1 +innodb_file_per_table +innodb_autoinc_lock_mode=2 +#wsrep_sst_method=rsync +wsrep_sst_method=mariabackup +wsrep_sst_auth=root: +binlog_format=ROW +core-file +log-output=none +wsrep_slave_threads=2 +wsrep_on=1 +gtid_strict_mode=1 +log_slave_updates=ON +log_bin=binlog + +[mysqld.2] +# server-id=102 +#wsrep-debug=1 +innodb_file_per_table +innodb_autoinc_lock_mode=2 +#wsrep_sst_method=rsync +wsrep_sst_method=mariabackup +wsrep_sst_auth=root: +binlog_format=ROW +core-file +log-output=none +wsrep_slave_threads=2 +wsrep_on=1 +gtid_strict_mode=1 +log_slave_updates=ON +log_bin=binlog + +[mysqld.1] +wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' + +[mysqld.2] +wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' + +[sst] +transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_ist_MDEV-28423.test b/mysql-test/suite/galera/t/galera_ist_MDEV-28423.test new file mode 100644 index 00000000000..8668c4ce158 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_ist_MDEV-28423.test @@ -0,0 +1,18 @@ +# MDEV-28423: Galera IST is failing on Joiner node + +--source include/big_test.inc +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_mariabackup.inc + +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + +--source suite/galera/include/galera_st_disconnect_slave.inc +--source suite/galera/include/galera_st_shutdown_slave.inc + +--source suite/galera/include/galera_st_kill_slave.inc +--source suite/galera/include/galera_st_kill_slave_ddl.inc + +--source include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf b/mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf new file mode 100644 index 00000000000..3835cd02a41 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf @@ -0,0 +1,44 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +# server-id=101 +#wsrep-debug=1 +innodb_file_per_table +innodb_autoinc_lock_mode=2 +wsrep_sst_method=rsync +#wsrep_sst_method=mariabackup +wsrep_sst_auth=root: +binlog_format=ROW +core-file +log-output=none +wsrep_slave_threads=2 +wsrep_on=1 +gtid_strict_mode=1 +log_slave_updates=ON +log_bin=binlog + +[mysqld.2] +# server-id=102 +#wsrep-debug=1 +innodb_file_per_table +innodb_autoinc_lock_mode=2 +wsrep_sst_method=rsync +#wsrep_sst_method=mariabackup +wsrep_sst_auth=root: +binlog_format=ROW +core-file +log-output=none +wsrep_slave_threads=2 +wsrep_on=1 +gtid_strict_mode=1 +log_slave_updates=ON +log_bin=binlog + +[mysqld.1] +wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' + +[mysqld.2] +wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' + +[sst] +transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_ist_MDEV-28583.test b/mysql-test/suite/galera/t/galera_ist_MDEV-28583.test new file mode 100644 index 00000000000..2c8c0bd80da --- /dev/null +++ b/mysql-test/suite/galera/t/galera_ist_MDEV-28583.test @@ -0,0 +1,18 @@ +# MDEV-28583: Galera: binlogs disappear after rsync IST + +--source include/big_test.inc +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_mariabackup.inc + +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + +--source suite/galera/include/galera_st_disconnect_slave.inc +--source suite/galera/include/galera_st_shutdown_slave.inc + +--source suite/galera/include/galera_st_kill_slave.inc +--source suite/galera/include/galera_st_kill_slave_ddl.inc + +--source include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/galera_many_tables_nopk.test b/mysql-test/suite/galera/t/galera_many_tables_nopk.test index 98a65b7c660..5bfab686726 100644 --- a/mysql-test/suite/galera/t/galera_many_tables_nopk.test +++ b/mysql-test/suite/galera/t/galera_many_tables_nopk.test @@ -7,18 +7,17 @@ if (!`SELECT @@open_files_limit >= 1024`){ } # -# This test forces 900 tables without a PK to participate in a single -# transaction. The reason for 900 is that some linux system has by default -# a limit of 1024 open files / process +# This test forces 100 tables without a PK to participate in a single +# transaction. # # -# First, create 900 tables +# First, create 100 tables # --connection node_1 ---let $count = 900 +--let $count = 100 while ($count) { --disable_query_log @@ -28,7 +27,7 @@ while ($count) --dec $count } ---let $count = 900 +--let $count = 100 while ($count) { --disable_query_log @@ -39,13 +38,13 @@ while ($count) } # -# Second, perform 900 updates +# Second, perform 100 updates # SET AUTOCOMMIT=OFF; START TRANSACTION; ---let $count = 900 +--let $count = 100 while ($count) { --disable_query_log @@ -63,7 +62,7 @@ COMMIT; --connection node_2 CREATE TABLE sum_table (f1 INTEGER); ---let $count = 900 +--let $count = 100 while ($count) { --disable_query_log @@ -73,7 +72,7 @@ while ($count) --dec $count } -SELECT SUM(f1) = 900 FROM sum_table; +SELECT SUM(f1) = 100 FROM sum_table; # # Fourth, create a deadlock @@ -83,7 +82,7 @@ SELECT SUM(f1) = 900 FROM sum_table; SET AUTOCOMMIT=OFF; START TRANSACTION; ---let $count = 900 +--let $count = 100 while ($count) { --disable_query_log @@ -96,7 +95,7 @@ while ($count) --connection node_2 SET AUTOCOMMIT=OFF; START TRANSACTION; -UPDATE t900 SET f1 = 3; +UPDATE t100 SET f1 = 3; --connection node_1 COMMIT; diff --git a/mysql-test/suite/galera/t/galera_read_only.test b/mysql-test/suite/galera/t/galera_read_only.test index c0fa4af07e0..56fe2fdd910 100644 --- a/mysql-test/suite/galera/t/galera_read_only.test +++ b/mysql-test/suite/galera/t/galera_read_only.test @@ -28,9 +28,20 @@ CREATE USER foo@localhost; --connection foo_node_2 --error ER_OPTION_PREVENTS_STATEMENT INSERT INTO t1 VALUES (2); +# Writes to temporary tables are allowed +CREATE TEMPORARY TABLE t2(id int not null primary key) engine=innodb; +INSERT INTO t2 values (1); +DROP TABLE t2; --connection node_2 -SELECT COUNT(*) = 1 FROM t1; +SELECT COUNT(*) AS EXPECT_1 FROM t1; + +--connection node_2 +SET GLOBAL read_only=TRUE; +# Writes to temporary tables are allowed +CREATE TEMPORARY TABLE t2(id int not null primary key) engine=innodb; +INSERT INTO t2 values (1); +DROP TABLE t2; # Cleanup SET GLOBAL read_only=FALSE; diff --git a/mysql-test/suite/galera_3nodes/r/galera_wsrep_schema.result b/mysql-test/suite/galera_3nodes/r/galera_wsrep_schema.result index f51eb815cd5..deef311b1e4 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_wsrep_schema.result +++ b/mysql-test/suite/galera_3nodes/r/galera_wsrep_schema.result @@ -74,3 +74,4 @@ cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHER SELECT COUNT(*) AS EXPECT_3 FROM mysql.wsrep_cluster_members; EXPECT_3 3 +disconnect node_3; diff --git a/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema.test b/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema.test index 52bbf3a652c..d6e20d3bbfb 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema.test +++ b/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema.test @@ -17,6 +17,9 @@ # Make the test fail if table structure has changed +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + SHOW CREATE TABLE mysql.wsrep_cluster; SHOW CREATE TABLE mysql.wsrep_cluster_members; @@ -74,3 +77,5 @@ SELECT cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STAT SELECT COUNT(*) AS EXPECT_3 FROM mysql.wsrep_cluster_members; --source ../galera/include/auto_increment_offset_restore.inc + +--disconnect node_3 diff --git a/mysql-test/suite/galera_sr/r/galera_sr_shutdown_slave.result b/mysql-test/suite/galera_sr/r/galera_sr_shutdown_slave.result index 902aa27d5aa..34995d35a4f 100644 --- a/mysql-test/suite/galera_sr/r/galera_sr_shutdown_slave.result +++ b/mysql-test/suite/galera_sr/r/galera_sr_shutdown_slave.result @@ -2,6 +2,8 @@ connection node_2; connection node_1; connection node_1; connection node_2; +connection node_2; +call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:.*"); connection node_1; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE = InnoDB; connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; diff --git a/mysql-test/suite/galera_sr/t/galera_sr_shutdown_slave.test b/mysql-test/suite/galera_sr/t/galera_sr_shutdown_slave.test index d1b0d4b8c88..5d4a58b2d03 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_shutdown_slave.test +++ b/mysql-test/suite/galera_sr/t/galera_sr_shutdown_slave.test @@ -8,6 +8,8 @@ --let $node_1=node_1 --let $node_2=node_2 --source ../galera/include/auto_increment_offset_save.inc +--connection node_2 +call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:.*"); --connection node_1 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE = InnoDB; diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result index 49fe8e629e3..19b426009f2 100644 --- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result +++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result @@ -69,8 +69,6 @@ buffer_pool_bytes_dirty buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL buffer_pool_pages_free buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Buffer pages currently free (innodb_buffer_pool_pages_free) buffer_pages_created buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages created (innodb_pages_created) buffer_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages written (innodb_pages_written) -buffer_index_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of index pages written (innodb_index_pages_written) -buffer_non_index_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of non index pages written (innodb_non_index_pages_written) buffer_pages_read buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages read (innodb_pages_read) buffer_index_sec_rec_cluster_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of secondary record reads triggered cluster read buffer_index_sec_rec_cluster_reads_avoided buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of secondary record reads avoided triggering cluster read diff --git a/mysql-test/suite/innodb/r/innodb_status_variables.result b/mysql-test/suite/innodb/r/innodb_status_variables.result index da5020bbe08..a729dd0a8d4 100644 --- a/mysql-test/suite/innodb/r/innodb_status_variables.result +++ b/mysql-test/suite/innodb/r/innodb_status_variables.result @@ -90,8 +90,6 @@ INNODB_TRUNCATED_STATUS_WRITES INNODB_AVAILABLE_UNDO_LOGS INNODB_UNDO_TRUNCATIONS INNODB_PAGE_COMPRESSION_SAVED -INNODB_NUM_INDEX_PAGES_WRITTEN -INNODB_NUM_NON_INDEX_PAGES_WRITTEN INNODB_NUM_PAGES_PAGE_COMPRESSED INNODB_NUM_PAGE_COMPRESSED_TRIM_OP INNODB_NUM_PAGES_PAGE_DECOMPRESSED @@ -118,7 +116,6 @@ INNODB_ENCRYPTION_ROTATION_PAGES_READ_FROM_DISK INNODB_ENCRYPTION_ROTATION_PAGES_MODIFIED INNODB_ENCRYPTION_ROTATION_PAGES_FLUSHED INNODB_ENCRYPTION_ROTATION_ESTIMATED_IOPS -INNODB_ENCRYPTION_KEY_ROTATION_LIST_LENGTH INNODB_ENCRYPTION_N_MERGE_BLOCKS_ENCRYPTED INNODB_ENCRYPTION_N_MERGE_BLOCKS_DECRYPTED INNODB_ENCRYPTION_N_ROWLOG_BLOCKS_ENCRYPTED diff --git a/mysql-test/suite/innodb/r/monitor.result b/mysql-test/suite/innodb/r/monitor.result index 2e5e5e2241a..caa4b33df6c 100644 --- a/mysql-test/suite/innodb/r/monitor.result +++ b/mysql-test/suite/innodb/r/monitor.result @@ -35,8 +35,6 @@ buffer_pool_bytes_dirty disabled buffer_pool_pages_free disabled buffer_pages_created disabled buffer_pages_written disabled -buffer_index_pages_written disabled -buffer_non_index_pages_written disabled buffer_pages_read disabled buffer_index_sec_rec_cluster_reads disabled buffer_index_sec_rec_cluster_reads_avoided disabled diff --git a/mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result b/mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result new file mode 100644 index 00000000000..f4d257c2668 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result @@ -0,0 +1,46 @@ +include/master-slave.inc +[connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=slave_pos; +# +# Initialize test data +connection master; +create table t1 (a int); +SET @@session.server_id= 3; +create table t2 (a int); +include/save_master_gtid.inc +# +# Have the replica "reconnect" and the primary will send Gtid, Glle, DDL +connection slave; +set global gtid_slave_pos="0-3-1"; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Ensure that the replica did not error +connection slave; +include/sync_with_master_gtid.inc +Last_SQL_Error = +Last_SQL_Errno = 0 +# +# Ensure that the primary sent a Glle after a Gtid event +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS +slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000002 # Gtid_list # # [] +slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001 +slave-relay-bin.000002 # Gtid # # GTID #-#-# +slave-relay-bin.000002 # Gtid_list # # [#-#-#] +slave-relay-bin.000002 # Query # # use `test`; create table t2 (a int) +# +# Ensure the DDL was executed on the replica +# +# Cleanup +# t1 does not make it to the replica +connection master; +set sql_log_bin=0; +DROP TABLE t1; +set sql_log_bin=1; +DROP TABLE t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test b/mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test new file mode 100644 index 00000000000..f0f38a31da6 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test @@ -0,0 +1,72 @@ +# +# Purpose: +# If a fake Glle event follows a Gtid event, we need to ensure the rest of +# the group should not terminate at the Glle event. MDEV-28550 revealed that +# a Glle would terminate the event and upon reconnect, the DDL would be lost. +# +# Methodology: +# Force the primary to send a fake GLLE event after a GTID on a "reconnect" +# and ensure that both 1) the replica does not error, and 2) the original +# command within the GTID is executed. +# +# References: +# MDEV-28550: improper handling of replication event group that contains Gtid_log_list_event + +--source include/master-slave.inc + +# Independent of binlog format +--source include/have_binlog_format_statement.inc + +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=slave_pos; + +--echo # +--echo # Initialize test data +--connection master +create table t1 (a int); +SET @@session.server_id= 3; +create table t2 (a int); +--source include/save_master_gtid.inc + +--echo # +--echo # Have the replica "reconnect" and the primary will send Gtid, Glle, DDL +--connection slave +eval set global gtid_slave_pos="0-3-1"; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +--echo # +--echo # Ensure that the replica did not error +connection slave; +--source include/sync_with_master_gtid.inc +let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); +--echo Last_SQL_Error = $error +let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1); +--echo Last_SQL_Errno = $errno + +--echo # +--echo # Ensure that the primary sent a Glle after a Gtid event +let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1); +let $binlog_start= $relaylog_start; +let $binlog_limit=0,10; +--source include/show_relaylog_events.inc + +--echo # +--echo # Ensure the DDL was executed on the replica +if (!`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'test' AND table_name = 't2'`) +{ + die "t2 should exist on slave"; +} + +--echo # +--echo # Cleanup + +--echo # t1 does not make it to the replica +--connection master +set sql_log_bin=0; +DROP TABLE t1; +set sql_log_bin=1; +DROP TABLE t2; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/sys_vars/r/group_concat_max_len_func.result b/mysql-test/suite/sys_vars/r/group_concat_max_len_func.result index 30e2639af37..01f44ae51be 100644 --- a/mysql-test/suite/sys_vars/r/group_concat_max_len_func.result +++ b/mysql-test/suite/sys_vars/r/group_concat_max_len_func.result @@ -94,4 +94,58 @@ DROP TABLE t1; disconnect test_con2; disconnect test_con1; connection default; +CREATE TABLE t1(val VARCHAR(100) PRIMARY KEY) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci; +INSERT INTO t1 VALUES('bar'); +INSERT INTO t1 VALUES('foo'); +SET group_concat_max_len = 1073741823; +SHOW VARIABLES LIKE 'group_concat_max_len'; +Variable_name Value +group_concat_max_len 1073741823 +SELECT GROUP_CONCAT(val) AS simple FROM t1; +simple +bar,foo +SELECT * FROM ( SELECT GROUP_CONCAT(val) AS nested FROM t1) As tmp; +nested +bar,foo +SET group_concat_max_len = 1073741824; +SHOW VARIABLES LIKE 'group_concat_max_len'; +Variable_name Value +group_concat_max_len 1073741824 +SELECT GROUP_CONCAT(val) AS simple FROM t1; +simple +bar,foo +SELECT * FROM ( SELECT GROUP_CONCAT(val) AS nested FROM t1) As tmp; +nested +bar,foo +SET group_concat_max_len = 1073741825; +SHOW VARIABLES LIKE 'group_concat_max_len'; +Variable_name Value +group_concat_max_len 1073741825 +SELECT GROUP_CONCAT(val) AS simple FROM t1; +simple +bar,foo +SELECT * FROM ( SELECT GROUP_CONCAT(val) AS nested FROM t1) As tmp; +nested +bar,foo +SET group_concat_max_len = 1073741826; +SHOW VARIABLES LIKE 'group_concat_max_len'; +Variable_name Value +group_concat_max_len 1073741826 +SELECT GROUP_CONCAT(val) AS simple FROM t1; +simple +bar,foo +SELECT * FROM ( SELECT GROUP_CONCAT(val) AS nested FROM t1) As tmp; +nested +bar,foo +SET group_concat_max_len = 2147483649; +SHOW VARIABLES LIKE 'group_concat_max_len'; +Variable_name Value +group_concat_max_len 2147483649 +SELECT GROUP_CONCAT(val) AS simple FROM t1; +simple +bar,foo +SELECT * FROM ( SELECT GROUP_CONCAT(val) AS nested FROM t1) As tmp; +nested +bar,foo +DROP TABLE t1; SET @@global.group_concat_max_len = @save; diff --git a/mysql-test/suite/sys_vars/t/group_concat_max_len_func.test b/mysql-test/suite/sys_vars/t/group_concat_max_len_func.test index b053ee229d7..d90fc061289 100644 --- a/mysql-test/suite/sys_vars/t/group_concat_max_len_func.test +++ b/mysql-test/suite/sys_vars/t/group_concat_max_len_func.test @@ -132,4 +132,35 @@ disconnect test_con1; connection default; +CREATE TABLE t1(val VARCHAR(100) PRIMARY KEY) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci; +INSERT INTO t1 VALUES('bar'); +INSERT INTO t1 VALUES('foo'); + +SET group_concat_max_len = 1073741823; +SHOW VARIABLES LIKE 'group_concat_max_len'; +SELECT GROUP_CONCAT(val) AS simple FROM t1; +SELECT * FROM ( SELECT GROUP_CONCAT(val) AS nested FROM t1) As tmp; + +SET group_concat_max_len = 1073741824; +SHOW VARIABLES LIKE 'group_concat_max_len'; +SELECT GROUP_CONCAT(val) AS simple FROM t1; +SELECT * FROM ( SELECT GROUP_CONCAT(val) AS nested FROM t1) As tmp; + +SET group_concat_max_len = 1073741825; +SHOW VARIABLES LIKE 'group_concat_max_len'; +SELECT GROUP_CONCAT(val) AS simple FROM t1; +SELECT * FROM ( SELECT GROUP_CONCAT(val) AS nested FROM t1) As tmp; + +SET group_concat_max_len = 1073741826; +SHOW VARIABLES LIKE 'group_concat_max_len'; +SELECT GROUP_CONCAT(val) AS simple FROM t1; +SELECT * FROM ( SELECT GROUP_CONCAT(val) AS nested FROM t1) As tmp; + +SET group_concat_max_len = 2147483649; +SHOW VARIABLES LIKE 'group_concat_max_len'; +SELECT GROUP_CONCAT(val) AS simple FROM t1; +SELECT * FROM ( SELECT GROUP_CONCAT(val) AS nested FROM t1) As tmp; + +DROP TABLE t1; + SET @@global.group_concat_max_len = @save; diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result index 8e791ce89e4..5a23dd24bb9 100644 --- a/mysql-test/suite/versioning/r/partition.result +++ b/mysql-test/suite/versioning/r/partition.result @@ -1525,6 +1525,18 @@ count(*) 100 drop table t1; # +# MDEV-28552 Assertion `inited==RND' failed in handler::ha_rnd_end +# +create table tcount (c int unsigned); +insert into tcount values (0); +create table t (f int) with system versioning +partition by system_time limit 1000 +(partition p1 history, partition pn current); +insert into t values (1),(2); +create trigger tr before insert on t for each row update tcount set c = c + 1; +insert into t select * from t; +drop table tcount, t; +# # End of 10.3 tests # # diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index 82b8fac4795..59fe672a98e 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -1370,6 +1370,23 @@ select count(*) from t1 partition (p0); select count(*) from t1 partition (p1); drop table t1; +--echo # +--echo # MDEV-28552 Assertion `inited==RND' failed in handler::ha_rnd_end +--echo # +create table tcount (c int unsigned); +insert into tcount values (0); + +create table t (f int) with system versioning +partition by system_time limit 1000 +(partition p1 history, partition pn current); +insert into t values (1),(2); +create trigger tr before insert on t for each row update tcount set c = c + 1; + +insert into t select * from t; + +# cleanup +drop table tcount, t; + --echo # --echo # End of 10.3 tests --echo # diff --git a/scripts/galera_new_cluster.sh b/scripts/galera_new_cluster.sh index e0763ed516a..ac9dcf42102 100755 --- a/scripts/galera_new_cluster.sh +++ b/scripts/galera_new_cluster.sh @@ -22,7 +22,7 @@ EOF fi systemctl set-environment _WSREP_NEW_CLUSTER='--wsrep-new-cluster' && \ - systemctl start ${1:-mariadb} + systemctl restart ${1:-mariadb} extcode=$? diff --git a/scripts/wsrep_sst_backup.sh b/scripts/wsrep_sst_backup.sh index 55e11ddffc0..301739905b6 100644 --- a/scripts/wsrep_sst_backup.sh +++ b/scripts/wsrep_sst_backup.sh @@ -64,7 +64,7 @@ then [ -f "$FLUSHED" ] && rm -f "$FLUSHED" [ -f "$ERROR" ] && rm -f "$ERROR" - echo "flush tables" + echo "flush tables" # Wait for : # (a) Tables to be flushed, AND @@ -72,7 +72,7 @@ then # (c) ERROR file, in case flush tables operation failed. while [ ! -r "$FLUSHED" ] && \ - ! grep -q -F ':' '--' "$FLUSHED" >/dev/null 2>&1 + ! grep -q -F ':' -- "$FLUSHED" >/dev/null 2>&1 do # Check whether ERROR file exists. if [ -f "$ERROR" ]; then @@ -98,15 +98,11 @@ then echo "done $STATE" -elif [ "$WSREP_SST_OPT_ROLE" = 'joiner' ] -then - wsrep_log_error "Unrecognized role: '$WSREP_SST_OPT_ROLE'" +else # joiner + + wsrep_log_error "Unsupported role: '$WSREP_SST_OPT_ROLE'" exit 22 # EINVAL - -else - wsrep_log_error "Unrecognized role: '$WSREP_SST_OPT_ROLE'" - exit 22 # EINVAL fi exit 0 diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index cc5db9e9e01..9d69ddf63a1 100644 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@ -17,7 +17,8 @@ # This is a common command line parser to be sourced by other SST scripts -set -ue +trap 'exit 32' HUP PIPE +trap 'exit 3' INT QUIT TERM # Setting the path for some utilities on CentOS export PATH="$PATH:/usr/sbin:/usr/bin:/sbin:/bin" @@ -184,7 +185,7 @@ case "$1" in shift ;; '--bypass') - WSREP_SST_OPT_BYPASS=1 + readonly WSREP_SST_OPT_BYPASS=1 ;; '--datadir') # Let's remove the trailing slash: @@ -511,7 +512,24 @@ case "$1" in esac shift done -readonly WSREP_SST_OPT_BYPASS + +WSREP_TRANSFER_TYPE='SST' +[ $WSREP_SST_OPT_BYPASS -ne 0 ] && readonly WSREP_TRANSFER_TYPE='IST' +# Let's take the name of the current script as a base, +# removing the directory, extension and "wsrep_sst_" prefix: +WSREP_METHOD="${0##*/}" +WSREP_METHOD="${WSREP_METHOD%.*}" +readonly WSREP_METHOD="${WSREP_METHOD#wsrep_sst_}" +if [ -n "${WSREP_SST_OPT_ROLE+x}" ]; then + if [ "$WSREP_SST_OPT_ROLE" != 'donor' -a \ + "$WSREP_SST_OPT_ROLE" != 'joiner' ] + then + wsrep_log_error "Unrecognized role: '$WSREP_SST_OPT_ROLE'" + exit 22 # EINVAL + fi +else + readonly WSREP_SST_OPT_ROLE='donor' +fi # The same argument can be present on the command line several # times, in this case we must take its last value: @@ -719,7 +737,7 @@ wsrep_log() { # echo everything to stderr so that it gets into common error log # deliberately made to look different from the rest of the log - local readonly tst="$(date +%Y%m%d\ %H:%M:%S.%N | cut -b -21)" + local readonly tst=$(date "+%Y%m%d %H:%M:%S.%N" | cut -b -21) echo "WSREP_SST: $* ($tst)" >&2 } @@ -1050,7 +1068,7 @@ is_local_ip() [ "$1" = '127.0.0.1' -o \ "$1" = '127.0.0.2' -o \ "$1" = 'localhost' -o \ - "$1" = '[::1]' ] && return 0 + "$1" = '::1' ] && return 0 # If the address starts with "127." this is probably a local # address, but we need to clarify what follows this prefix: if [ "${1#127.}" != "$1" ]; then @@ -1067,21 +1085,25 @@ is_local_ip() "$1" = "$(hostname -f)" -o \ "$1" = "$(hostname -d)" ] && return 0 fi + # If the address contains anything other than digits + # and separators, it is not a local address: + [ "${1#*[!0-9.]}" != "$1" ] && \ + [ "${1#*[!0-9A-Fa-f:\[\]]}" != "$1" ] && return 1 # Now let's check if the given address is assigned to # one of the network cards: local ip_util=$(commandex 'ip') if [ -n "$ip_util" ]; then # ip address show ouput format is " inet[6]
/