diff options
Diffstat (limited to 'mysql-test/suite')
20 files changed, 430 insertions, 359 deletions
diff --git a/mysql-test/suite/bugs/t/bug57108.test b/mysql-test/suite/bugs/t/bug57108.test index 1006a7b30f1..56acd7fe7bd 100644 --- a/mysql-test/suite/bugs/t/bug57108.test +++ b/mysql-test/suite/bugs/t/bug57108.test @@ -5,7 +5,7 @@ # switched directory after starting the server and am using a relative # --defaults-file. --replace_regex /\.dll/.so/ -eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO; +eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN'; --query_vertical SELECT @@global.connect_timeout AS connect_timeout, @@global.local_infile AS local_infile diff --git a/mysql-test/suite/perfschema/r/server_init.result b/mysql-test/suite/perfschema/r/server_init.result index b6f1d4828c3..26104197686 100644 --- a/mysql-test/suite/perfschema/r/server_init.result +++ b/mysql-test/suite/perfschema/r/server_init.result @@ -31,10 +31,6 @@ select count(name) from mutex_instances where name like "wait/synch/mutex/mysys/THR_LOCK_charset"; count(name) 1 -select count(name) from mutex_instances -where name like "wait/synch/mutex/mysys/THR_LOCK_time"; -count(name) -1 select count(name) from cond_instances where name like "wait/synch/cond/mysys/THR_COND_threads"; count(name) diff --git a/mysql-test/suite/perfschema/t/server_init.test b/mysql-test/suite/perfschema/t/server_init.test index 33eeeb7edb2..95d8be0e864 100644 --- a/mysql-test/suite/perfschema/t/server_init.test +++ b/mysql-test/suite/perfschema/t/server_init.test @@ -52,9 +52,6 @@ select count(name) from mutex_instances select count(name) from mutex_instances where name like "wait/synch/mutex/mysys/THR_LOCK_charset"; -select count(name) from mutex_instances - where name like "wait/synch/mutex/mysys/THR_LOCK_time"; - # There are no global rwlock in mysys # Verify that these global conditions have been properly initilized in mysys diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index ccef60d6323..ef901476784 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -16,7 +16,7 @@ RESET SLAVE; *** Reset slave affect *** SET @@global.slave_net_timeout=30; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5; RESET SLAVE; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; Variable_name Value @@ -24,7 +24,7 @@ Slave_heartbeat_period 15.000 *** Default value if slave_net_timeout changed *** SET @@global.slave_net_timeout=50; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root'; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; Variable_name Value Slave_heartbeat_period 25.000 @@ -39,14 +39,14 @@ SET @@global.slave_net_timeout=@restore_slave_net_timeout; RESET SLAVE; *** Warning if updated slave_heartbeat_timeout > slave_net_timeout *** -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=SLAVE_NET_TIMEOUT; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=SLAVE_NET_TIMEOUT; Warnings: Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout. RESET SLAVE; *** CHANGE MASTER statement only updates slave_heartbeat_period *** SET @@global.slave_net_timeout=20; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5; SHOW VARIABLES LIKE 'slave_net_timeout'; Variable_name Value slave_net_timeout 20 @@ -67,7 +67,7 @@ RESET SLAVE; SET @@global.slave_net_timeout=500; SET @@global.slave_net_timeout=200; RESET SLAVE; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root'; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20; include/start_slave.inc SHOW VARIABLES LIKE 'slave_net_timeout'; Variable_name Value @@ -82,7 +82,7 @@ SET @@global.slave_net_timeout=@restore_slave_net_timeout; *** Start/stop slave *** SET @@global.slave_net_timeout=100; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=20; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=20; include/start_slave.inc SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; Variable_name Value @@ -94,7 +94,7 @@ Slave_heartbeat_period 20.000 *** Reload slave *** SET @@global.slave_net_timeout=50; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=30; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=30; include/rpl_restart_server.inc [server_number=2] SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; Variable_name Value @@ -102,7 +102,7 @@ Slave_heartbeat_period 30.000 SET @restore_slave_net_timeout=@@global.slave_net_timeout; *** Disable heartbeat *** -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; Variable_name Value Slave_heartbeat_period 0.000 @@ -129,12 +129,12 @@ Result 0 *** Min slave_heartbeat_timeout *** -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.001; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.001; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; Variable_name Value Slave_heartbeat_period 0.001 RESET SLAVE; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.0009; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.0009; Warnings: Warning 1703 The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled. SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; @@ -143,36 +143,36 @@ Slave_heartbeat_period 0.000 RESET SLAVE; *** Max slave_heartbeat_timeout *** -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=4294967; Warnings: Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout. SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; Variable_name Value Slave_heartbeat_period 4294967.000 RESET SLAVE; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294968; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=4294968; ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds). RESET SLAVE; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=8589935; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=8589935; ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds). RESET SLAVE; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967296; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=4294967296; ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds). RESET SLAVE; *** Misc incorrect values *** -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='-1'; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD='-1'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''-1'' at line 1 RESET SLAVE; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='123abc'; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD='123abc'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''123abc'' at line 1 RESET SLAVE; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=''; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=''; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''' at line 1 RESET SLAVE; *** Running slave *** -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1; include/start_slave.inc Heartbeat event received @@ -218,7 +218,7 @@ BEGIN UPDATE test.t1 SET a = a + 1 WHERE a < 10; END| RESET SLAVE; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5; include/start_slave.inc SET @@global.event_scheduler=1; Number of received heartbeat events: 0 @@ -231,7 +231,7 @@ RESET SLAVE; DROP TABLE t1; DROP TABLE t1; RESET MASTER; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.5; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.5; include/start_slave.inc Heartbeat events are received while rotation of relay logs (1 means 'yes'): 1 @@ -240,7 +240,7 @@ SET @@global.slave_compressed_protocol=1; include/stop_slave.inc RESET SLAVE; SET @@global.slave_compressed_protocol=1; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1; include/start_slave.inc Heartbeat event received SET @@global.slave_compressed_protocol=0; @@ -249,7 +249,7 @@ SET @@global.slave_compressed_protocol=0; *** Reset master *** STOP SLAVE; RESET SLAVE; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1; include/start_slave.inc RESET MASTER; Heartbeat events are received after reset of master (1 means 'yes'): 1 @@ -257,7 +257,7 @@ Heartbeat events are received after reset of master (1 means 'yes'): 1 *** Reload master *** STOP SLAVE; RESET SLAVE; -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_CONNECT_RETRY = 5; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1; include/start_slave.inc Heartbeat event received include/rpl_restart_server.inc [server_number=1] diff --git a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result index 71d1ca9a928..7c55e44ed59 100644 --- a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result +++ b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result @@ -1,14 +1,12 @@ include/master-slave.inc [connection master] +include/rpl_reset.inc CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (3); -INSERT INTO t1 VALUES (4); -INSERT INTO t1 VALUES (5); -INSERT INTO t1 VALUES (6); -[MASTER] ********* SOW BINLOG EVENTS IN ... ********* -show binlog events from <binlog_start>; +******** [master] SHOW BINLOG EVENTS IN <FILE> ******** +show binlog events in 'master-bin.000001' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) master-bin.000001 # Query # # BEGIN @@ -23,19 +21,17 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +show binlog events in 'master-bin.000001' from <binlog_start> limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show binlog events in 'master-bin.000001' from <binlog_start> limit 1,3; +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -[MASTER] ********* SOW BINLOG EVENTS ********* +******** [master] SHOW BINLOG EVENTS ******** show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) @@ -51,33 +47,8 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -[MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows ********* -show binlog events from <binlog_start> limit 3; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -[MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -show binlog events from <binlog_start> limit 1,4; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -[SLAVE] ********* SOW BINLOG EVENTS IN ... ********* -show binlog events from <binlog_start>; +******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** +show binlog events in 'slave-bin.000001' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) slave-bin.000001 # Query # # BEGIN @@ -92,19 +63,17 @@ slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Table_map # # table_id: # (test.t1) slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F slave-bin.000001 # Query # # COMMIT +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +show binlog events in 'slave-bin.000001' from <binlog_start> limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show binlog events in 'slave-bin.000001' from <binlog_start> limit 1,3; +Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Table_map # # table_id: # (test.t1) slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Table_map # # table_id: # (test.t1) -slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Table_map # # table_id: # (test.t1) -slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -slave-bin.000001 # Query # # COMMIT -[SLAVE] ********* SOW BINLOG EVENTS ********* +******** [slave] SHOW BINLOG EVENTS ******** show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) @@ -120,85 +89,53 @@ slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Table_map # # table_id: # (test.t1) slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Table_map # # table_id: # (test.t1) -slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Table_map # # table_id: # (test.t1) -slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Table_map # # table_id: # (test.t1) -slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -slave-bin.000001 # Query # # COMMIT -[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows ********* -show binlog events from <binlog_start> limit 3; +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** +show relaylog events in 'slave-relay-bin.000003' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Table_map # # table_id: # (test.t1) -[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -show binlog events from <binlog_start> limit 1,4; +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4 +slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000003 # Query # # COMMIT +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** +show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Table_map # # table_id: # (test.t1) -slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -slave-bin.000001 # Query # # COMMIT -[SLAVE] ********* SOW RELAYLOG EVENTS IN ... ********* -show relaylog events in 'slave-relay-bin.000002' from <binlog_start>; +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4 +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1,3; Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=4 -slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT) -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Table_map # # table_id: # (test.t1) -slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F -slave-relay-bin.000002 # Query # # COMMIT -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Table_map # # table_id: # (test.t1) -slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F -slave-relay-bin.000002 # Query # # COMMIT -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Table_map # # table_id: # (test.t1) -slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F -slave-relay-bin.000002 # Query # # COMMIT -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Table_map # # table_id: # (test.t1) -slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F -slave-relay-bin.000002 # Query # # COMMIT -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Table_map # # table_id: # (test.t1) -slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F -slave-relay-bin.000002 # Query # # COMMIT -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Table_map # # table_id: # (test.t1) -slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F -slave-relay-bin.000002 # Query # # COMMIT -[SLAVE] ********* SOW RELAYLOG EVENTS ********* +slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-relay-bin.000003 # Query # # BEGIN +******** [slave] SHOW RELAYLOG EVENTS ******** show relaylog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000001 # Rotate # # slave-relay-bin.000002;pos=4 -[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows ********* -show relaylog events in 'slave-relay-bin.000002' from <binlog_start> limit 3; -Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=4 -slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT) -[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows ********* -show relaylog events in 'slave-relay-bin.000002' from <binlog_start> limit 1,3; -Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT) -slave-relay-bin.000002 # Query # # BEGIN +slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4 FLUSH LOGS; FLUSH LOGS; DROP TABLE t1; -[MASTER] ********* SOW BINLOG EVENTS IN ... ********* +******** [master] SHOW BINLOG EVENTS IN <FILE> ******** show binlog events in 'master-bin.000002' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ -[MASTER] ********* SOW BINLOG EVENTS ********* +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +show binlog events in 'master-bin.000002' from <binlog_start> limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show binlog events in 'master-bin.000002' from <binlog_start> limit 1,3; +Log_name Pos Event_type Server_id End_log_pos Info +******** [master] SHOW BINLOG EVENTS ******** show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) @@ -214,24 +151,19 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT master-bin.000001 # Rotate # # master-bin.000002;pos=4 -[SLAVE] ********* SOW BINLOG EVENTS IN ... ********* +******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** show binlog events in 'slave-bin.000002' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ -[SLAVE] ********* SOW BINLOG EVENTS ********* +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +show binlog events in 'slave-bin.000002' from <binlog_start> limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show binlog events in 'slave-bin.000002' from <binlog_start> limit 1,3; +Log_name Pos Event_type Server_id End_log_pos Info +******** [slave] SHOW BINLOG EVENTS ******** show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) @@ -247,27 +179,25 @@ slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Table_map # # table_id: # (test.t1) slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Table_map # # table_id: # (test.t1) -slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Table_map # # table_id: # (test.t1) -slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Table_map # # table_id: # (test.t1) -slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Rotate # # slave-bin.000002;pos=4 -[SLAVE] ********* SOW RELAYLOG EVENTS IN ... ********* -show relaylog events from <binlog_start>; -Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000004 # Rotate # # master-bin.000002;pos=4 -slave-relay-bin.000004 # Rotate # # slave-relay-bin.000005;pos=4 -[SLAVE] ********* SOW RELAYLOG EVENTS ********* +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** +show relaylog events in 'slave-relay-bin.000006' from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4 +slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** +show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4 +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1,3; +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW RELAYLOG EVENTS ******** show relaylog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000004 # Rotate # # master-bin.000002;pos=4 -slave-relay-bin.000004 # Rotate # # slave-relay-bin.000005;pos=4 +slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4 +slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4 include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result index 0e34c0dfb19..f706fa0fe75 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result +++ b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result @@ -1,14 +1,12 @@ include/master-slave.inc [connection master] +include/rpl_reset.inc CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (3); -INSERT INTO t1 VALUES (4); -INSERT INTO t1 VALUES (5); -INSERT INTO t1 VALUES (6); -[MASTER] ********* SOW BINLOG EVENTS IN ... ********* -show binlog events from <binlog_start>; +******** [master] SHOW BINLOG EVENTS IN <FILE> ******** +show binlog events in 'master-bin.000001' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) master-bin.000001 # Query # # BEGIN @@ -20,16 +18,17 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) master-bin.000001 # Query # # COMMIT +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +show binlog events in 'master-bin.000001' from <binlog_start> limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show binlog events in 'master-bin.000001' from <binlog_start> limit 1,3; +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) master-bin.000001 # Query # # COMMIT -[MASTER] ********* SOW BINLOG EVENTS ********* +******** [master] SHOW BINLOG EVENTS ******** show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) @@ -42,30 +41,8 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) -master-bin.000001 # Query # # COMMIT -[MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows ********* -show binlog events from <binlog_start> limit 3; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) -[MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -show binlog events from <binlog_start> limit 1,4; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -[SLAVE] ********* SOW BINLOG EVENTS IN ... ********* -show binlog events from <binlog_start>; +******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** +show binlog events in 'slave-bin.000001' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) slave-bin.000001 # Query # # BEGIN @@ -77,16 +54,17 @@ slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) slave-bin.000001 # Query # # COMMIT +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +show binlog events in 'slave-bin.000001' from <binlog_start> limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show binlog events in 'slave-bin.000001' from <binlog_start> limit 1,3; +Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) slave-bin.000001 # Query # # COMMIT -[SLAVE] ********* SOW BINLOG EVENTS ********* +******** [slave] SHOW BINLOG EVENTS ******** show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) @@ -99,76 +77,50 @@ slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) -slave-bin.000001 # Query # # COMMIT -[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows ********* -show binlog events from <binlog_start> limit 3; -Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) -[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -show binlog events from <binlog_start> limit 1,4; -Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -[SLAVE] ********* SOW RELAYLOG EVENTS IN ... ********* -show relaylog events in 'slave-relay-bin.000002' from <binlog_start>; -Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=4 -slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT) -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (1) -slave-relay-bin.000002 # Query # # COMMIT -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (2) -slave-relay-bin.000002 # Query # # COMMIT -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (3) -slave-relay-bin.000002 # Query # # COMMIT -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (4) -slave-relay-bin.000002 # Query # # COMMIT -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (5) -slave-relay-bin.000002 # Query # # COMMIT -slave-relay-bin.000002 # Query # # BEGIN -slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (6) -slave-relay-bin.000002 # Query # # COMMIT -[SLAVE] ********* SOW RELAYLOG EVENTS ********* +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** +show relaylog events in 'slave-relay-bin.000003' from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4 +slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (1) +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (2) +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (3) +slave-relay-bin.000003 # Query # # COMMIT +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** +show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4 +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1,3; +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-relay-bin.000003 # Query # # BEGIN +******** [slave] SHOW RELAYLOG EVENTS ******** show relaylog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000001 # Rotate # # slave-relay-bin.000002;pos=4 -[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows ********* -show relaylog events in 'slave-relay-bin.000002' from <binlog_start> limit 3; -Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=4 -slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT) -[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows ********* -show relaylog events in 'slave-relay-bin.000002' from <binlog_start> limit 1,3; -Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT) -slave-relay-bin.000002 # Query # # BEGIN +slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4 FLUSH LOGS; FLUSH LOGS; DROP TABLE t1; -[MASTER] ********* SOW BINLOG EVENTS IN ... ********* +******** [master] SHOW BINLOG EVENTS IN <FILE> ******** show binlog events in 'master-bin.000002' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ -[MASTER] ********* SOW BINLOG EVENTS ********* +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +show binlog events in 'master-bin.000002' from <binlog_start> limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show binlog events in 'master-bin.000002' from <binlog_start> limit 1,3; +Log_name Pos Event_type Server_id End_log_pos Info +******** [master] SHOW BINLOG EVENTS ******** show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) @@ -181,21 +133,19 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) -master-bin.000001 # Query # # COMMIT master-bin.000001 # Rotate # # master-bin.000002;pos=4 -[SLAVE] ********* SOW BINLOG EVENTS IN ... ********* +******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** show binlog events in 'slave-bin.000002' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ -[SLAVE] ********* SOW BINLOG EVENTS ********* +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +show binlog events in 'slave-bin.000002' from <binlog_start> limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show binlog events in 'slave-bin.000002' from <binlog_start> limit 1,3; +Log_name Pos Event_type Server_id End_log_pos Info +******** [slave] SHOW BINLOG EVENTS ******** show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) @@ -208,24 +158,25 @@ slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) -slave-bin.000001 # Query # # COMMIT -slave-bin.000001 # Query # # BEGIN -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) -slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Rotate # # slave-bin.000002;pos=4 -[SLAVE] ********* SOW RELAYLOG EVENTS IN ... ********* -show relaylog events from <binlog_start>; -Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000004 # Rotate # # master-bin.000002;pos=4 -slave-relay-bin.000004 # Rotate # # slave-relay-bin.000005;pos=4 -[SLAVE] ********* SOW RELAYLOG EVENTS ********* +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** +show relaylog events in 'slave-relay-bin.000006' from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4 +slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** +show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1; +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4 +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** +show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1,3; +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW RELAYLOG EVENTS ******** show relaylog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info -slave-relay-bin.000004 # Rotate # # master-bin.000002;pos=4 -slave-relay-bin.000004 # Rotate # # slave-relay-bin.000005;pos=4 +slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4 +slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4 include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result index 97a53e025be..527a942900c 100644 --- a/mysql-test/suite/rpl/r/rpl_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result @@ -74,5 +74,47 @@ include/wait_for_slave_sql_to_start.inc # Test end SET GLOBAL debug= '$debug_save'; +include/restart_slave.inc +[connection master] +DROP TABLE t1, t2; + +# Bug#58546 test rpl_packet timeout failure sporadically on PB +# ---------------------------------------------------------------------- +# STOP SLAVE stopped IO thread first and then stopped SQL thread. It was +# possible that IO thread stopped after replicating part of a transaction +# which SQL thread was executing. SQL thread would be hung if the +# transaction could not be rolled back safely. +# It caused some sporadic failures on PB2. +# +# This test verifies that when 'STOP SLAVE' is issued by a user, IO +# thread will continue to fetch the rest events of the transaction which +# is being executed by SQL thread and is not able to be rolled back safely. +CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; +CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES(1, 1); +SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; +[connection slave] +include/restart_slave.inc +BEGIN; +UPDATE t1 SET c2 = 2 WHERE c1 = 1; +[connection master] +BEGIN; +INSERT INTO t1 VALUES(2, 2); +INSERT INTO t2 VALUES(1); +UPDATE t1 SET c2 = 3 WHERE c1 = 1; +COMMIT; +[connection slave1] +STOP SLAVE; +[connection slave] +ROLLBACK; +[connection master] +SET DEBUG_SYNC= 'now SIGNAL signal.continue'; +SET DEBUG_SYNC= 'RESET'; +[connection slave] +include/wait_for_slave_to_stop.inc +[connection slave1] +include/start_slave.inc +[connection master] DROP TABLE t1, t2; +SET GLOBAL debug= $debug_save; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index f4806bdba1e..9f49dfd7714 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -16,3 +16,5 @@ rpl_row_create_table : Bug#51574 2010-02-27 andrei failed different way tha rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux rpl_log_pos : BUG#55675 2010-09-10 alfranio rpl.rpl_log_pos fails sporadically with error binlog truncated in the middle rpl_get_master_version_and_clock : Bug#59178 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock +rpl_row_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out +rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out diff --git a/mysql-test/suite/rpl/t/rpl_cross_version.test b/mysql-test/suite/rpl/t/rpl_cross_version.test index 7a8cbfd8237..94c9f0432ce 100644 --- a/mysql-test/suite/rpl/t/rpl_cross_version.test +++ b/mysql-test/suite/rpl/t/rpl_cross_version.test @@ -12,11 +12,6 @@ --source include/master-slave.inc -# The test is disabled for windows due to -# Bug #42879 CHANGE MASTER RELAY_LOG_FILE=path fails on windows -# Todo: release it from not_windows ---source include/not_windows.inc - # # Bug#31240 load data infile replication between (4.0 or 4.1) and 5.1 fails # diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index 94667485dfe..a89a1847bc6 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -18,6 +18,9 @@ --source include/have_binlog_format_mixed.inc --echo +# Set number of retries to connect to master +let $connect_retry= 20; + --echo *** Preparing *** --connection slave --source include/stop_slave.inc @@ -57,7 +60,7 @@ RESET SLAVE; SET @@global.slave_net_timeout=30; --enable_warnings --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=5; RESET SLAVE; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; --echo @@ -68,7 +71,7 @@ SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; SET @@global.slave_net_timeout=50; --enable_warnings --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root'; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; SET @@global.slave_net_timeout=@restore_slave_net_timeout; RESET SLAVE; @@ -88,7 +91,7 @@ RESET SLAVE; let $slave_net_timeout= query_get_value(SHOW VARIABLES LIKE 'slave_net_timeout', Value, 1); inc $slave_net_timeout; --replace_result $MASTER_MYPORT MASTER_PORT $slave_net_timeout SLAVE_NET_TIMEOUT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=$slave_net_timeout; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=$slave_net_timeout; RESET SLAVE; --echo @@ -98,7 +101,7 @@ RESET SLAVE; SET @@global.slave_net_timeout=20; --enable_warnings --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=5; SHOW VARIABLES LIKE 'slave_net_timeout'; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; SET @@global.slave_net_timeout=2*@@global.slave_net_timeout; @@ -118,7 +121,7 @@ SET @@global.slave_net_timeout=500; SET @@global.slave_net_timeout=200; RESET SLAVE; --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root'; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry; --source include/start_slave.inc --connection master --sync_slave_with_master @@ -138,7 +141,7 @@ SET @@global.slave_net_timeout=@restore_slave_net_timeout; SET @@global.slave_net_timeout=100; --enable_warnings --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=20; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=20; --source include/start_slave.inc --connection master --sync_slave_with_master @@ -154,7 +157,7 @@ SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; SET @@global.slave_net_timeout=50; --enable_warnings --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=30; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=30; --let $rpl_server_number= 2 --source include/rpl_restart_server.inc SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; @@ -164,7 +167,7 @@ SET @restore_slave_net_timeout=@@global.slave_net_timeout; # Disable heartbeat --echo *** Disable heartbeat *** --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; SHOW STATUS LIKE 'slave_received_heartbeats'; --source include/start_slave.inc @@ -188,48 +191,48 @@ let $slave_heartbeat_timeout= query_get_value(SHOW GLOBAL STATUS LIKE 'slave_hea --echo *** Min slave_heartbeat_timeout *** --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.001; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.001; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; RESET SLAVE; --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.0009; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.0009; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; RESET SLAVE; --echo --echo *** Max slave_heartbeat_timeout *** --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=4294967; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; RESET SLAVE; --replace_result $MASTER_MYPORT MASTER_PORT --error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294968; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=4294968; RESET SLAVE; # Check double size of max allowed value for master_heartbeat_period --replace_result $MASTER_MYPORT MASTER_PORT --error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=8589935; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=8589935; RESET SLAVE; # Check 2^32 --replace_result $MASTER_MYPORT MASTER_PORT --error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967296; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=4294967296; RESET SLAVE; --echo --echo *** Misc incorrect values *** --replace_result $MASTER_MYPORT MASTER_PORT --error ER_PARSE_ERROR -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='-1'; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD='-1'; RESET SLAVE; --replace_result $MASTER_MYPORT MASTER_PORT --error ER_PARSE_ERROR -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='123abc'; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD='123abc'; RESET SLAVE; --replace_result $MASTER_MYPORT MASTER_PORT --error ER_PARSE_ERROR -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=''; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=''; RESET SLAVE; --echo @@ -240,7 +243,7 @@ RESET SLAVE; # Check received heartbeat events for running slave --echo *** Running slave *** --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1; --source include/start_slave.inc --connection master --sync_slave_with_master @@ -342,7 +345,7 @@ DELIMITER ;| --connection slave RESET SLAVE; --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=5; --source include/start_slave.inc --connection master # Enable scheduler @@ -374,7 +377,7 @@ DROP TABLE t1; RESET MASTER; --connection slave --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.5; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.5; let $slave_param_comparison= =; --source include/start_slave.inc let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); @@ -401,7 +404,7 @@ SET @@global.slave_compressed_protocol=1; RESET SLAVE; SET @@global.slave_compressed_protocol=1; --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1; --source include/start_slave.inc let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); let $status_var= slave_received_heartbeats; @@ -420,7 +423,7 @@ SET @@global.slave_compressed_protocol=0; STOP SLAVE; RESET SLAVE; --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1; --source include/start_slave.inc let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); --connection master @@ -439,7 +442,7 @@ let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_b STOP SLAVE; RESET SLAVE; --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_CONNECT_RETRY = 5; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1; --source include/start_slave.inc # Wait until slave_received_heartbeats will be incremented let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); @@ -474,7 +477,7 @@ let $status_var_comparsion= >; #let $slave_binlog= query_get_value(SHOW MASTER STATUS, File, 1); --connection master #--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG -#eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog'; +#eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog'; --source include/start_slave.inc # Insert data on master and on slave and make sure that it replicated for both directions diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index 69d59e02e2d..7e9a35883a3 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -26,8 +26,8 @@ let $old_net_buffer_length= `SELECT @@global.net_buffer_length`; SET @@global.max_allowed_packet=1024; SET @@global.net_buffer_length=1024; +sync_slave_with_master; # Restart slave for setting to take effect -connection slave; source include/stop_slave.inc; source include/start_slave.inc; diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test index 1529f98397a..ace11cc1467 100644 --- a/mysql-test/suite/rpl/t/rpl_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test @@ -45,7 +45,69 @@ source extra/rpl_tests/rpl_stop_slave.test; --echo --echo # Test end SET GLOBAL debug= '$debug_save'; +source include/restart_slave_sql.inc; -connection master; +--source include/rpl_connection_master.inc DROP TABLE t1, t2; + +--echo +--echo # Bug#58546 test rpl_packet timeout failure sporadically on PB +--echo # ---------------------------------------------------------------------- +--echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was +--echo # possible that IO thread stopped after replicating part of a transaction +--echo # which SQL thread was executing. SQL thread would be hung if the +--echo # transaction could not be rolled back safely. +--echo # It caused some sporadic failures on PB2. +--echo # +--echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO +--echo # thread will continue to fetch the rest events of the transaction which +--echo # is being executed by SQL thread and is not able to be rolled back safely. + +CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; +CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES(1, 1); + +let $debug_save= `SELECT @@GLOBAL.debug`; +SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; + +sync_slave_with_master; + +--source include/rpl_connection_slave.inc +source include/restart_slave_sql.inc; + +BEGIN; +UPDATE t1 SET c2 = 2 WHERE c1 = 1; + +--source include/rpl_connection_master.inc +BEGIN; +INSERT INTO t1 VALUES(2, 2); +INSERT INTO t2 VALUES(1); +UPDATE t1 SET c2 = 3 WHERE c1 = 1; +COMMIT; + +--source include/rpl_connection_slave1.inc +let $show_statement= SHOW PROCESSLIST; +let $field= Info; +let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1'; +source include/wait_show_condition.inc; + +send STOP SLAVE; + +--source include/rpl_connection_slave.inc +ROLLBACK; + +--source include/rpl_connection_master.inc +SET DEBUG_SYNC= 'now SIGNAL signal.continue'; +SET DEBUG_SYNC= 'RESET'; + +--source include/rpl_connection_slave.inc +source include/wait_for_slave_to_stop.inc; + +--source include/rpl_connection_slave1.inc +reap; +source include/start_slave.inc; + +--source include/rpl_connection_master.inc +DROP TABLE t1, t2; +SET GLOBAL debug= $debug_save; --source include/rpl_end.inc diff --git a/mysql-test/suite/sys_vars/r/autocommit_func4.result b/mysql-test/suite/sys_vars/r/autocommit_func4.result new file mode 100644 index 00000000000..5fcb50526f2 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/autocommit_func4.result @@ -0,0 +1,46 @@ +CREATE TABLE t1 +( +id INT NOT NULL auto_increment, +PRIMARY KEY (id), +name varchar(30) +) ENGINE = INNODB; +SELECT @@global.autocommit; +@@global.autocommit +1 +SELECT @@autocommit; +@@autocommit +1 +INSERT into t1(name) values('Record_1'); +INSERT into t1(name) values('Record_2'); +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +ROLLBACK; +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +set @@global.autocommit = 1-@@global.autocommit; +set @@autocommit = 1-@@autocommit; +SELECT @@global.autocommit; +@@global.autocommit +0 +SELECT @@autocommit; +@@autocommit +0 +INSERT into t1(name) values('Record_1'); +INSERT into t1(name) values('Record_2'); +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +3 Record_1 +4 Record_2 +ROLLBACK; +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +DROP TABLE t1; +set @@global.autocommit = 1-@@global.autocommit; diff --git a/mysql-test/suite/sys_vars/r/autocommit_func5.result b/mysql-test/suite/sys_vars/r/autocommit_func5.result new file mode 100644 index 00000000000..6807c594cb1 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/autocommit_func5.result @@ -0,0 +1,42 @@ +CREATE TABLE t1 +( +id INT NOT NULL auto_increment, +PRIMARY KEY (id), +name varchar(30) +) ENGINE = INNODB; +SELECT @@global.autocommit; +@@global.autocommit +0 +SELECT @@autocommit; +@@autocommit +0 +INSERT into t1(name) values('Record_1'); +INSERT into t1(name) values('Record_2'); +SELECT * from t1; +id name +1 Record_1 +2 Record_2 +ROLLBACK; +SELECT * from t1; +id name +set @@global.autocommit = 1-@@global.autocommit; +set @@autocommit = 1-@@autocommit; +SELECT @@global.autocommit; +@@global.autocommit +1 +SELECT @@autocommit; +@@autocommit +1 +INSERT into t1(name) values('Record_1'); +INSERT into t1(name) values('Record_2'); +SELECT * from t1; +id name +3 Record_1 +4 Record_2 +ROLLBACK; +SELECT * from t1; +id name +3 Record_1 +4 Record_2 +DROP TABLE t1; +set @@global.autocommit = 1-@@global.autocommit; diff --git a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result index baf06092126..55de5adbc33 100644 --- a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result +++ b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result @@ -64,12 +64,12 @@ SET last = pct; END IF; END WHILE; END// -CREATE PROCEDURE check_pct(IN num DECIMAL) +CREATE PROCEDURE check_pct(IN success_on_wait BOOLEAN) BEGIN -IF (dirty_pct() < num) THEN +IF (success_on_wait > 0) THEN SELECT 'BELOW_MAX' AS PCT_VALUE; ELSE -SELECT 'ABOVE_MAX' AS PCT_VALUE; +SELECT 'ABOVE_MAX or TimeOut Of The Test' AS PCT_VALUE; END IF; END// CREATE TABLE t1( @@ -83,7 +83,7 @@ CALL add_until(10); FLUSH TABLES; CALL add_records(500); 'We expect dirty pages pct to be BELOW_MAX after some time depending on performance' -CALL check_pct(10); +CALL check_pct(1); PCT_VALUE BELOW_MAX DROP PROCEDURE add_records; diff --git a/mysql-test/suite/sys_vars/t/autocommit_func4-master.opt b/mysql-test/suite/sys_vars/t/autocommit_func4-master.opt new file mode 100644 index 00000000000..788990274dd --- /dev/null +++ b/mysql-test/suite/sys_vars/t/autocommit_func4-master.opt @@ -0,0 +1 @@ +--autocommit=on diff --git a/mysql-test/suite/sys_vars/t/autocommit_func4.test b/mysql-test/suite/sys_vars/t/autocommit_func4.test new file mode 100644 index 00000000000..9bb4c26d5d5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/autocommit_func4.test @@ -0,0 +1 @@ +--source suite/sys_vars/inc/autocommit_func2.inc diff --git a/mysql-test/suite/sys_vars/t/autocommit_func5-master.opt b/mysql-test/suite/sys_vars/t/autocommit_func5-master.opt new file mode 100644 index 00000000000..409cb3ec891 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/autocommit_func5-master.opt @@ -0,0 +1 @@ +--autocommit=off diff --git a/mysql-test/suite/sys_vars/t/autocommit_func5.test b/mysql-test/suite/sys_vars/t/autocommit_func5.test new file mode 100644 index 00000000000..9bb4c26d5d5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/autocommit_func5.test @@ -0,0 +1 @@ +--source suite/sys_vars/inc/autocommit_func2.inc diff --git a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test index b577ae5fcc4..c7a9e567e69 100644 --- a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test +++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test @@ -117,12 +117,12 @@ BEGIN END WHILE; END// -CREATE PROCEDURE check_pct(IN num DECIMAL) +CREATE PROCEDURE check_pct(IN success_on_wait BOOLEAN) BEGIN - IF (dirty_pct() < num) THEN + IF (success_on_wait > 0) THEN SELECT 'BELOW_MAX' AS PCT_VALUE; ELSE - SELECT 'ABOVE_MAX' AS PCT_VALUE; + SELECT 'ABOVE_MAX or TimeOut Of The Test' AS PCT_VALUE; END IF; END// @@ -155,7 +155,8 @@ let $wait_condition= SELECT (dirty_pct() <= @@global.innodb_max_dirty_pages_pct) --source include/wait_condition.inc --echo 'We expect dirty pages pct to be BELOW_MAX after some time depending on performance' -CALL check_pct(10); +# Value For $sucess will be set from include/wait_condition.inc file. It can have values 1 or 0. It will be 1 if dirty_pct() <= @@global.innodb_max_dirty_pages_pct else it will be 0. +eval CALL check_pct($success); DROP PROCEDURE add_records; DROP PROCEDURE add_until; DROP PROCEDURE check_pct; |