Commit 55d7871f authored by Sergei Golubchik's avatar Sergei Golubchik

test cleanup: remove Format_description_log_event size dependency

1. use include/show_binlog_events.inc instead of SHOW BINLOG EVENTS
2. use include/show_relaylog_eventc.inc too
3. in all other places where a number might appear in the result
   file, include binlog_start_pos.inc, calculate the position
   like pos=`select $binlog_start_pos + 100`; and use
   replace_result $pos <pos>
parent 8aa473c4
...@@ -336,12 +336,12 @@ RESET MASTER; ...@@ -336,12 +336,12 @@ RESET MASTER;
RESET MASTER; RESET MASTER;
SHOW MASTER STATUS; SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 313 master-bin.000001 <pos>
RESET MASTER TO 100; RESET MASTER TO 100;
SHOW MASTER STATUS; SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000100 313 master-bin.000100 <pos>
RESET MASTER; RESET MASTER;
SHOW MASTER STATUS; SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 313 master-bin.000001 <pos>
...@@ -332,12 +332,12 @@ a b ...@@ -332,12 +332,12 @@ a b
2 1 2 1
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
SHOW BINLOG EVENTS LIMIT 7,3; include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 593 Xid 1 620 COMMIT /* XID */ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 620 Gtid 1 658 GTID 0-1-3 master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (1,0), (2,0)
master-bin.000001 658 Query 1 777 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB master-bin.000001 # Xid # # COMMIT /* XID */
-- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=939; -- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=<pos>;
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a a
1 1
......
...@@ -15,20 +15,17 @@ ALTER TABLE t1 ANALYZE PARTITION p1; ...@@ -15,20 +15,17 @@ ALTER TABLE t1 ANALYZE PARTITION p1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK test.t1 analyze status OK
SHOW BINLOG EVENTS; include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 248 Server ver: #, Binlog ver: # master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 248 Gtid_list 1 273 [] master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (i INT) ENGINE=InnoDB
master-bin.000001 273 Binlog_checkpoint 1 313 master-bin.000001 master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 313 Gtid 1 351 GTID 0-1-1 master-bin.000001 # Query # # use `test`; ANALYZE TABLE t1
master-bin.000001 351 Query 1 451 use `test`; CREATE TABLE t1 (i INT) ENGINE=InnoDB master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 451 Gtid 1 489 GTID 0-1-2 master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
master-bin.000001 489 Query 1 568 use `test`; ANALYZE TABLE t1 master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 568 Gtid 1 606 GTID 0-1-3 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2
master-bin.000001 606 Query 1 710 use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 710 Gtid 1 748 GTID 0-1-4 master-bin.000001 # Query # # use `test`; ALTER TABLE t1 ANALYZE PARTITION p1
master-bin.000001 748 Query 1 884 use `test`; CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2
master-bin.000001 884 Gtid 1 922 GTID 0-1-5
master-bin.000001 922 Query 1 1020 use `test`; ALTER TABLE t1 ANALYZE PARTITION p1
SET use_stat_tables = DEFAULT; SET use_stat_tables = DEFAULT;
DROP TABLE t1; DROP TABLE t1;
...@@ -3,11 +3,11 @@ RESET MASTER; ...@@ -3,11 +3,11 @@ RESET MASTER;
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
SHOW MASTER STATUS; SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 486 master-bin.000001 <pos>
SHOW STATUS LIKE 'binlog_snapshot_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value Variable_name Value
Binlog_snapshot_file master-bin.000001 Binlog_snapshot_file master-bin.000001
Binlog_snapshot_position 486 Binlog_snapshot_position <pos>
BEGIN; BEGIN;
INSERT INTO t1 VALUES (0, ""); INSERT INTO t1 VALUES (0, "");
# Connection con1 # Connection con1
...@@ -38,10 +38,10 @@ a b ...@@ -38,10 +38,10 @@ a b
SHOW STATUS LIKE 'binlog_snapshot_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value Variable_name Value
Binlog_snapshot_file master-bin.000001 Binlog_snapshot_file master-bin.000001
Binlog_snapshot_position 988 Binlog_snapshot_position <pos>
SHOW MASTER STATUS; SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 1340 master-bin.000001 <pos>
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a a
2 2
...@@ -60,50 +60,47 @@ a b ...@@ -60,50 +60,47 @@ a b
SHOW STATUS LIKE 'binlog_snapshot_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value Variable_name Value
Binlog_snapshot_file master-bin.000001 Binlog_snapshot_file master-bin.000001
Binlog_snapshot_position 988 Binlog_snapshot_position <pos>
SHOW MASTER STATUS; SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 367 master-bin.000002 <pos>
COMMIT; COMMIT;
SHOW STATUS LIKE 'binlog_snapshot_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
Variable_name Value Variable_name Value
Binlog_snapshot_file master-bin.000002 Binlog_snapshot_file master-bin.000002
Binlog_snapshot_position 367 Binlog_snapshot_position <pos>
SHOW MASTER STATUS; SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 367 master-bin.000002 <pos>
SHOW BINLOG EVENTS; include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 248 Server ver: #, Binlog ver: # master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 248 Gtid_list 1 273 [] master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
master-bin.000001 273 Binlog_checkpoint 1 313 master-bin.000001 master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 313 Gtid 1 351 GTID 0-1-1 master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
master-bin.000001 351 Query 1 486 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 486 Gtid 1 524 GTID 0-1-2 master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (2)
master-bin.000001 524 Query 1 636 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam master-bin.000001 # Query # # COMMIT
master-bin.000001 636 Gtid 1 674 BEGIN GTID 0-1-3 master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 674 Query 1 762 use `test`; INSERT INTO t2 VALUES (2) master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (0, "")
master-bin.000001 762 Query 1 831 COMMIT master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 831 Gtid 1 869 BEGIN GTID 0-1-4 master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 869 Query 1 961 use `test`; INSERT INTO t1 VALUES (0, "") master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (3)
master-bin.000001 961 Xid 1 988 COMMIT /* XID */ master-bin.000001 # Query # # COMMIT
master-bin.000001 988 Gtid 1 1026 BEGIN GTID 0-1-5 master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 1026 Query 1 1114 use `test`; INSERT INTO t2 VALUES (3) master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4, "")
master-bin.000001 1114 Query 1 1183 COMMIT master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 1183 Gtid 1 1221 BEGIN GTID 0-1-6 master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 1221 Query 1 1313 use `test`; INSERT INTO t1 VALUES (4, "") master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1, "")
master-bin.000001 1313 Xid 1 1340 COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 1340 Gtid 1 1378 BEGIN GTID 0-1-7 master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 1378 Query 1 1470 use `test`; INSERT INTO t1 VALUES (1, "") master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2, "first")
master-bin.000001 1470 Xid 1 1497 COMMIT /* XID */ master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2, "second")
master-bin.000001 1497 Gtid 1 1535 BEGIN GTID 0-1-8 master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 1535 Query 1 1632 use `test`; INSERT INTO t1 VALUES (2, "first") master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 1632 Query 1 1730 use `test`; INSERT INTO t1 VALUES (2, "second") master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3, "")
master-bin.000001 1730 Xid 1 1757 COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 1757 Gtid 1 1795 BEGIN GTID 0-1-9 master-bin.000001 # Rotate # # master-bin.000002;pos=POS
master-bin.000001 1795 Query 1 1887 use `test`; INSERT INTO t1 VALUES (3, "")
master-bin.000001 1887 Xid 1 1914 COMMIT /* XID */
master-bin.000001 1914 Rotate 1 1958 master-bin.000002;pos=4
*** MDEV-7310: last_commit_pos_offset set to wrong value after binlog rotate in group commit *** *** MDEV-7310: last_commit_pos_offset set to wrong value after binlog rotate in group commit ***
SET @old_size= @@GLOBAL.max_binlog_size; SET @old_size= @@GLOBAL.max_binlog_size;
SET GLOBAL max_binlog_size=4096; SET GLOBAL max_binlog_size=4096;
......
...@@ -31,6 +31,6 @@ a ...@@ -31,6 +31,6 @@ a
1 1
2 2
3 3
InnoDB: Last MySQL binlog file position 0 926, file name ./master-bin.000001 InnoDB: Last MySQL binlog file position 0 <pos>, file name ./master-bin.000001
SET DEBUG_SYNC= 'RESET'; SET DEBUG_SYNC= 'RESET';
DROP TABLE t1; DROP TABLE t1;
...@@ -32,6 +32,6 @@ a ...@@ -32,6 +32,6 @@ a
1 1
2 2
3 3
InnoDB: Last MySQL binlog file position 0 926, file name ./master-bin.000001 InnoDB: Last MySQL binlog file position 0 <pos>, file name ./master-bin.000001
SET DEBUG_SYNC= 'RESET'; SET DEBUG_SYNC= 'RESET';
DROP TABLE t1; DROP TABLE t1;
...@@ -8,22 +8,22 @@ optimize table t1; ...@@ -8,22 +8,22 @@ optimize table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize status OK test.t1 optimize status OK
drop table t1; drop table t1;
show binlog events in 'master-bin.000001' from 313; include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 313 Gtid 1 351 GTID 0-1-1 master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 351 Query 1 465 use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
master-bin.000001 465 Gtid 1 503 GTID 0-1-2 master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 503 Query 1 669 use `test`; create table t1(a int not null primary key auto_increment, b varchar(256), key second(b)) engine=innodb master-bin.000001 # Query # # use `test`; create table t1(a int not null primary key auto_increment, b varchar(256), key second(b)) engine=innodb
master-bin.000001 669 Gtid 1 707 BEGIN GTID 0-1-3 master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 707 Table_map 1 751 table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 751 Write_rows_v1 1 1043 table_id: # flags: STMT_END_F master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 1043 Xid 1 1070 COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 1070 Gtid 1 1108 BEGIN GTID 0-1-4 master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 1108 Table_map 1 1152 table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 1152 Write_rows_v1 1 1444 table_id: # flags: STMT_END_F master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 1444 Xid 1 1471 COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 1471 Gtid 1 1509 GTID 0-1-5 master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 1509 Query 1 1589 use `test`; optimize table t1 master-bin.000001 # Query # # use `test`; optimize table t1
master-bin.000001 1589 Gtid 1 1627 GTID 0-1-6 master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 1627 Query 1 1731 use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
include/rpl_end.inc include/rpl_end.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_log_bin.inc --source include/have_log_bin.inc
--source include/have_binlog_format_mixed_or_statement.inc --source include/have_binlog_format_mixed_or_statement.inc
--source include/binlog_start_pos.inc
RESET MASTER; RESET MASTER;
...@@ -16,7 +17,10 @@ connection default; ...@@ -16,7 +17,10 @@ connection default;
--echo # Connection default --echo # Connection default
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
let pos=`select $binlog_start_pos + 238`;
--replace_result $pos <pos>
SHOW MASTER STATUS; SHOW MASTER STATUS;
--replace_result $pos <pos>
SHOW STATUS LIKE 'binlog_snapshot_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
BEGIN; BEGIN;
INSERT INTO t1 VALUES (0, ""); INSERT INTO t1 VALUES (0, "");
...@@ -56,7 +60,11 @@ COMMIT; ...@@ -56,7 +60,11 @@ COMMIT;
connection default; connection default;
--echo # Connection default --echo # Connection default
SELECT * FROM t1 ORDER BY a,b; SELECT * FROM t1 ORDER BY a,b;
let pos=`select $binlog_start_pos + 740`;
--replace_result $pos <pos>
SHOW STATUS LIKE 'binlog_snapshot_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
let pos=`select $binlog_start_pos + 1092`;
--replace_result $pos <pos>
SHOW MASTER STATUS; SHOW MASTER STATUS;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
...@@ -77,14 +85,19 @@ FLUSH LOGS; ...@@ -77,14 +85,19 @@ FLUSH LOGS;
connection default; connection default;
--echo # Connection default --echo # Connection default
SELECT * FROM t1 ORDER BY a,b; SELECT * FROM t1 ORDER BY a,b;
let pos=`select $binlog_start_pos + 740`;
--replace_result $pos <pos>
SHOW STATUS LIKE 'binlog_snapshot_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
let pos=`select $binlog_start_pos + 119`;
--replace_result $pos <pos>
SHOW MASTER STATUS; SHOW MASTER STATUS;
COMMIT; COMMIT;
--replace_result $pos <pos>
SHOW STATUS LIKE 'binlog_snapshot_%'; SHOW STATUS LIKE 'binlog_snapshot_%';
--replace_result $pos <pos>
SHOW MASTER STATUS; SHOW MASTER STATUS;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ source include/show_binlog_events.inc;
SHOW BINLOG EVENTS;
--echo *** MDEV-7310: last_commit_pos_offset set to wrong value after binlog rotate in group commit *** --echo *** MDEV-7310: last_commit_pos_offset set to wrong value after binlog rotate in group commit ***
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
--source include/have_debug_sync.inc --source include/have_debug_sync.inc
--source include/have_log_bin.inc --source include/have_log_bin.inc
--source include/have_binlog_format_mixed_or_statement.inc --source include/have_binlog_format_mixed_or_statement.inc
--source include/binlog_start_pos.inc
# Need DBUG to crash the server intentionally # Need DBUG to crash the server intentionally
--source include/have_debug.inc --source include/have_debug.inc
...@@ -96,6 +97,8 @@ SELECT * FROM t1 ORDER BY a; ...@@ -96,6 +97,8 @@ SELECT * FROM t1 ORDER BY a;
# for the end of the second transaction (as can be checked with # for the end of the second transaction (as can be checked with
# mysqlbinlog). # mysqlbinlog).
let $MYSQLD_DATADIR= `SELECT @@datadir`; let $MYSQLD_DATADIR= `SELECT @@datadir`;
let pos=`select $binlog_start_pos + 678`;
--replace_result $pos <pos>
--exec grep 'InnoDB: Last MySQL binlog file position' $MYSQLD_DATADIR/../../log/mysqld.1.err | tail -1 --exec grep 'InnoDB: Last MySQL binlog file position' $MYSQLD_DATADIR/../../log/mysqld.1.err | tail -1
SET DEBUG_SYNC= 'RESET'; SET DEBUG_SYNC= 'RESET';
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
--source include/have_debug_sync.inc --source include/have_debug_sync.inc
--source include/have_log_bin.inc --source include/have_log_bin.inc
--source include/have_binlog_format_mixed_or_statement.inc --source include/have_binlog_format_mixed_or_statement.inc
--source include/binlog_start_pos.inc
# Need DBUG to crash the server intentionally # Need DBUG to crash the server intentionally
--source include/have_debug.inc --source include/have_debug.inc
...@@ -97,7 +98,8 @@ SELECT * FROM t1 ORDER BY a; ...@@ -97,7 +98,8 @@ SELECT * FROM t1 ORDER BY a;
# for the end of the second transaction (as can be checked with # for the end of the second transaction (as can be checked with
# mysqlbinlog). # mysqlbinlog).
let $MYSQLD_DATADIR= `SELECT @@datadir`; let $MYSQLD_DATADIR= `SELECT @@datadir`;
let pos=`select $binlog_start_pos + 678`;
--replace_result $pos <pos>
--exec grep 'InnoDB: Last MySQL binlog file position' $MYSQLD_DATADIR/../../log/mysqld.1.err | tail -1 --exec grep 'InnoDB: Last MySQL binlog file position' $MYSQLD_DATADIR/../../log/mysqld.1.err | tail -1
SET DEBUG_SYNC= 'RESET'; SET DEBUG_SYNC= 'RESET';
DROP TABLE t1; DROP TABLE t1;
...@@ -16,7 +16,6 @@ optimize table t1; ...@@ -16,7 +16,6 @@ optimize table t1;
drop table t1; drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ --source include/show_binlog_events.inc
show binlog events in 'master-bin.000001' from 313;
--source include/rpl_end.inc --source include/rpl_end.inc
...@@ -85,16 +85,16 @@ MASTER 2.2 ...@@ -85,16 +85,16 @@ MASTER 2.2
# #
show all slaves status; show all slaves status;
Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 relay.000002 601 master-bin.000001 Yes Yes 0 0 313 888 None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> relay.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000
MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 relay-master@00202@002e2.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000 MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> relay-master@00202@002e2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space2> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
include/wait_for_slave_to_start.inc include/wait_for_slave_to_start.inc
set default_master_connection = 'MASTER 2.2'; set default_master_connection = 'MASTER 2.2';
include/wait_for_slave_to_start.inc include/wait_for_slave_to_start.inc
set default_master_connection = ''; set default_master_connection = '';
show all slaves status; show all slaves status;
Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 relay.000004 536 master-bin.000001 Yes Yes 0 0 313 823 None 0 No 0 No 0 0 1 No conservative 0 1073741824 6 0 60.000 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> relay.000004 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No conservative 0 1073741824 6 0 60.000
MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 relay-master@00202@002e2.000004 536 master-bin.000001 Yes Yes 0 0 313 842 None 0 No 0 No 0 0 2 No conservative 0 1073741824 6 0 60.000 MASTER 2.2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> relay-master@00202@002e2.000004 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space2> None 0 No 0 No 0 0 2 No conservative 0 1073741824 6 0 60.000
# #
# List of files matching '*info*' pattern # List of files matching '*info*' pattern
# after slave server restart # after slave server restart
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# #
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/binlog_start_pos.inc
--let $rpl_server_count= 0 --let $rpl_server_count= 0
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) --connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
...@@ -136,8 +137,11 @@ let $field= Slave_IO_State; ...@@ -136,8 +137,11 @@ let $field= Slave_IO_State;
let $condition= = 'Waiting for master to send event'; let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc --source include/wait_show_condition.inc
let read_master_log_pos=`select $binlog_start_pos + 65`;
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 let relay_log_pos=`select 2*$binlog_start_pos + 105`;
let relay_log_space1=`select 3*$binlog_start_pos + 144`;
let relay_log_space2=`select 3*$binlog_start_pos + 163`;
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status; show all slaves status;
# Restart the slave server # Restart the slave server
...@@ -160,7 +164,10 @@ let $condition= = 'Waiting for master to send event'; ...@@ -160,7 +164,10 @@ let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc --source include/wait_show_condition.inc
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 let relay_log_pos=`select 2*$binlog_start_pos + 40`;
let relay_log_space1=`select 3*$binlog_start_pos + 79`;
let relay_log_space2=`select 3*$binlog_start_pos + 98`;
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status; show all slaves status;
# Check the files # Check the files
......
...@@ -52,27 +52,27 @@ i f1 ...@@ -52,27 +52,27 @@ i f1
mysqld-relay-bin-master1.000001 mysqld-relay-bin-master1.000001
mysqld-relay-bin-master1.000002 mysqld-relay-bin-master1.000002
mysqld-relay-bin-master1.index mysqld-relay-bin-master1.index
show relaylog events; include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
mysqld-relay-bin-master1.000001 4 Format_desc 3 248 Server version mysqld-relay-bin-master1.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
mysqld-relay-bin-master1.000001 248 Rotate 3 306 mysqld-relay-bin-master1.000002;pos=4 mysqld-relay-bin-master1.000001 # Rotate # # mysqld-relay-bin-master1.000002;pos=4
show relaylog events in 'mysqld-relay-bin-master1.000002'; include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
mysqld-relay-bin-master1.000002 4 Format_desc 3 248 Server version mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
mysqld-relay-bin-master1.000002 248 Rotate 1 0 master-bin.000001;pos=4 mysqld-relay-bin-master1.000002 # Rotate # # master-bin.000001;pos=POS
mysqld-relay-bin-master1.000002 292 Format_desc 1 248 Server version mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
mysqld-relay-bin-master1.000002 536 Gtid_list 1 273 [] mysqld-relay-bin-master1.000002 # Gtid_list # # []
mysqld-relay-bin-master1.000002 561 Binlog_checkpoint 1 313 master-bin.000001 mysqld-relay-bin-master1.000002 # Binlog_checkpoint # # master-bin.000001
mysqld-relay-bin-master1.000002 601 Gtid 1 351 GTID 0-1-1 mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
mysqld-relay-bin-master1.000002 639 Query 1 440 drop database if exists db1 mysqld-relay-bin-master1.000002 # Query # # drop database if exists db1
mysqld-relay-bin-master1.000002 728 Gtid 1 478 GTID 0-1-2 mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
mysqld-relay-bin-master1.000002 766 Query 1 559 create database db1 mysqld-relay-bin-master1.000002 # Query # # create database db1
mysqld-relay-bin-master1.000002 847 Gtid 1 597 GTID 0-1-3 mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
mysqld-relay-bin-master1.000002 885 Query 1 750 use `db1`; create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM mysqld-relay-bin-master1.000002 # Query # # use `db1`; create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM
mysqld-relay-bin-master1.000002 1038 Gtid 1 788 BEGIN GTID 0-1-4 mysqld-relay-bin-master1.000002 # Gtid # # BEGIN GTID #-#-#
mysqld-relay-bin-master1.000002 1076 Intvar 1 816 INSERT_ID=1 mysqld-relay-bin-master1.000002 # Intvar # # INSERT_ID=1
mysqld-relay-bin-master1.000002 1104 Query 1 920 use `db1`; insert into t1 (f1) values ('one'),('two') mysqld-relay-bin-master1.000002 # Query # # use `db1`; insert into t1 (f1) values ('one'),('two')
mysqld-relay-bin-master1.000002 1208 Query 1 988 COMMIT mysqld-relay-bin-master1.000002 # Query # # COMMIT
change master 'master1' to change master 'master1' to
master_port=MYPORT_2, master_port=MYPORT_2,
master_host='127.0.0.1', master_host='127.0.0.1',
...@@ -138,7 +138,7 @@ flush logs; ...@@ -138,7 +138,7 @@ flush logs;
purge binary logs to 'master-bin.000002'; purge binary logs to 'master-bin.000002';
show binary logs; show binary logs;
Log_name File_size Log_name File_size
master-bin.000002 367 master-bin.000002 filesize
insert into t1 (f1) values ('four'); insert into t1 (f1) values ('four');
create table db1.t3 (f1 int) engine=InnoDB; create table db1.t3 (f1 int) engine=InnoDB;
# #
...@@ -167,27 +167,27 @@ i f1 ...@@ -167,27 +167,27 @@ i f1
2 two 2 two
3 three 3 three
4 four 4 four
show relaylog events; include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
mysqld-relay-bin.000001 4 Format_desc 3 248 Server version mysqld-relay-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
mysqld-relay-bin.000001 248 Rotate 3 298 mysqld-relay-bin.000002;pos=4 mysqld-relay-bin.000001 # Rotate # # mysqld-relay-bin.000002;pos=4
show relaylog events in 'mysqld-relay-bin.000002'; include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
mysqld-relay-bin.000002 4 Format_desc 3 248 Server version mysqld-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
mysqld-relay-bin.000002 248 Rotate 2 0 master-bin.000001;pos=4 mysqld-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS
mysqld-relay-bin.000002 292 Format_desc 2 248 Server version mysqld-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
mysqld-relay-bin.000002 536 Gtid_list 2 273 [] mysqld-relay-bin.000002 # Gtid_list # # []
mysqld-relay-bin.000002 561 Binlog_checkpoint 2 313 master-bin.000001 mysqld-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001
mysqld-relay-bin.000002 601 Gtid 2 351 GTID 0-2-1 mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
mysqld-relay-bin.000002 639 Query 2 440 drop database if exists db2 mysqld-relay-bin.000002 # Query # # drop database if exists db2
mysqld-relay-bin.000002 728 Gtid 2 478 GTID 0-2-2 mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
mysqld-relay-bin.000002 766 Query 2 559 create database db2 mysqld-relay-bin.000002 # Query # # create database db2
mysqld-relay-bin.000002 847 Gtid 2 597 GTID 0-2-3 mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
mysqld-relay-bin.000002 885 Query 2 732 use `db2`; create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB mysqld-relay-bin.000002 # Query # # use `db2`; create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB
mysqld-relay-bin.000002 1020 Gtid 2 770 BEGIN GTID 0-2-4 mysqld-relay-bin.000002 # Gtid # # BEGIN GTID #-#-#
mysqld-relay-bin.000002 1058 Intvar 2 798 INSERT_ID=1 mysqld-relay-bin.000002 # Intvar # # INSERT_ID=1
mysqld-relay-bin.000002 1086 Query 2 894 use `db2`; insert into t1 (f1) values (1),(2) mysqld-relay-bin.000002 # Query # # use `db2`; insert into t1 (f1) values (1),(2)
mysqld-relay-bin.000002 1182 Xid 2 921 COMMIT /* xid=<num> */ mysqld-relay-bin.000002 # Xid # # COMMIT /* XID */
stop slave io_thread; stop slave io_thread;
show status like 'Slave_running'; show status like 'Slave_running';
Variable_name Value Variable_name Value
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/binlog_start_pos.inc
--let $rpl_server_count= 0 --let $rpl_server_count= 0
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) --connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
...@@ -99,11 +100,11 @@ select * from db1.t1; ...@@ -99,11 +100,11 @@ select * from db1.t1;
# Check that relay logs are recognizable # Check that relay logs are recognizable
--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/ let binlog_start=4;
show relaylog events; let binlog_file=;
--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/ source include/show_relaylog_events.inc;
show relaylog events in 'mysqld-relay-bin-master1.000002'; let binlog_file= mysqld-relay-bin-master1.000002;
source include/show_relaylog_events.inc;
# Try to configure connection with the same name again, # Try to configure connection with the same name again,
# should get an error because the slave is running # should get an error because the slave is running
...@@ -221,6 +222,8 @@ flush logs; ...@@ -221,6 +222,8 @@ flush logs;
--connection master1 --connection master1
purge binary logs to 'master-bin.000002'; purge binary logs to 'master-bin.000002';
let filesize=`select $binlog_start_pos+119`;
--replace_result $filesize filesize
show binary logs; show binary logs;
insert into t1 (f1) values ('four'); insert into t1 (f1) values ('four');
create table db1.t3 (f1 int) engine=InnoDB; create table db1.t3 (f1 int) engine=InnoDB;
...@@ -252,10 +255,10 @@ select * from db1.t1; ...@@ -252,10 +255,10 @@ select * from db1.t1;
# This should show relay log events for the default master # This should show relay log events for the default master
# (the one with the empty name) # (the one with the empty name)
--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/ let binlog_file=;
show relaylog events; source include/show_relaylog_events.inc;
--replace_regex /Server ver:.*/Server version/ /xid=[0-9]+/xid=<num>/ let binlog_file= mysqld-relay-bin.000002;
show relaylog events in 'mysqld-relay-bin.000002'; source include/show_relaylog_events.inc;
# Make sure we don't lose control over replication connections # Make sure we don't lose control over replication connections
# after reconnecting to the slave # after reconnecting to the slave
......
...@@ -17,6 +17,7 @@ server-id=3 ...@@ -17,6 +17,7 @@ server-id=3
log-warnings=2 log-warnings=2
[ENV] [ENV]
MASTER_MYPORT= @mysqld.1.port
SERVER_MYPORT_1= @mysqld.1.port SERVER_MYPORT_1= @mysqld.1.port
SERVER_MYSOCK_1= @mysqld.1.socket SERVER_MYSOCK_1= @mysqld.1.socket
SERVER_MYPORT_2= @mysqld.2.port SERVER_MYPORT_2= @mysqld.2.port
......
...@@ -10,21 +10,21 @@ create table t1 (i int) engine=MyISAM; ...@@ -10,21 +10,21 @@ create table t1 (i int) engine=MyISAM;
mysqld-relay-bin-master1.000001 mysqld-relay-bin-master1.000001
mysqld-relay-bin-master1.000002 mysqld-relay-bin-master1.000002
mysqld-relay-bin-master1.index mysqld-relay-bin-master1.index
show relaylog events in 'mysqld-relay-bin-master1.000002'; include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
mysqld-relay-bin-master1.000002 4 Format_desc 3 248 Server version mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
mysqld-relay-bin-master1.000002 248 Rotate 1 0 master-bin.000001;pos=4 mysqld-relay-bin-master1.000002 # Rotate # # master-bin.000001;pos=POS
mysqld-relay-bin-master1.000002 292 Format_desc 1 248 Server version mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
mysqld-relay-bin-master1.000002 536 Gtid_list 1 273 [] mysqld-relay-bin-master1.000002 # Gtid_list # # []
mysqld-relay-bin-master1.000002 561 Binlog_checkpoint 1 313 master-bin.000001 mysqld-relay-bin-master1.000002 # Binlog_checkpoint # # master-bin.000001
mysqld-relay-bin-master1.000002 601 Gtid 1 351 GTID 0-1-1 mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
mysqld-relay-bin-master1.000002 639 Query 1 465 use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ mysqld-relay-bin-master1.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
mysqld-relay-bin-master1.000002 753 Gtid 1 503 GTID 0-1-2 mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
mysqld-relay-bin-master1.000002 791 Query 1 603 use `test`; create table t1 (i int) engine=MyISAM mysqld-relay-bin-master1.000002 # Query # # use `test`; create table t1 (i int) engine=MyISAM
show relaylog events; include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
mysqld-relay-bin-master1.000001 4 Format_desc 3 248 Server version mysqld-relay-bin-master1.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
mysqld-relay-bin-master1.000001 248 Rotate 3 306 mysqld-relay-bin-master1.000002;pos=4 mysqld-relay-bin-master1.000001 # Rotate # # mysqld-relay-bin-master1.000002;pos=4
drop table t1; drop table t1;
include/reset_master_slave.inc include/reset_master_slave.inc
include/reset_master_slave.inc include/reset_master_slave.inc
...@@ -31,10 +31,11 @@ create table t1 (i int) engine=MyISAM; ...@@ -31,10 +31,11 @@ create table t1 (i int) engine=MyISAM;
--let $datadir = `SELECT @@datadir` --let $datadir = `SELECT @@datadir`
--list_files $datadir mysqld-relay-bin-master1.* --list_files $datadir mysqld-relay-bin-master1.*
--replace_regex /Server ver:.*/Server version/ let binlog_start=4;
show relaylog events in 'mysqld-relay-bin-master1.000002'; let binlog_file= mysqld-relay-bin-master1.000002;
--replace_regex /Server ver:.*/Server version/ source include/show_relaylog_events.inc;
show relaylog events; let binlog_file=;
source include/show_relaylog_events.inc;
--connection master1 --connection master1
drop table t1; drop table t1;
......
...@@ -11,14 +11,14 @@ insert into t1 values (1),(2); ...@@ -11,14 +11,14 @@ insert into t1 values (1),(2);
stop slave 'master1'; stop slave 'master1';
show slave 'master1' status; show slave 'master1' status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
127.0.0.1 root MYPORT_1 60 master-bin.000001 802 mysqld-relay-bin-master1.000002 1090 master-bin.000001 No No 0 0 802 1396 None 0 No NULL No 0 0 1 No conservative 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-master1.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space> None 0 No NULL No 0 0 1 No conservative
mysqld-relay-bin-master1.000001 mysqld-relay-bin-master1.000001
mysqld-relay-bin-master1.000002 mysqld-relay-bin-master1.000002
mysqld-relay-bin-master1.index mysqld-relay-bin-master1.index
reset slave 'master1'; reset slave 'master1';
show slave 'master1' status; show slave 'master1' status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
127.0.0.1 root MYPORT_1 60 4 1090 No No 0 0 0 1396 None 0 No NULL No 0 0 1 No conservative 127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space> None 0 No NULL No 0 0 1 No conservative
reset slave 'master1' all; reset slave 'master1' all;
show slave 'master1' status; show slave 'master1' status;
ERROR HY000: There is no master connection 'master1' ERROR HY000: There is no master connection 'master1'
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# #
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/binlog_start_pos.inc
--let $rpl_server_count= 0 --let $rpl_server_count= 0
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) --connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
...@@ -38,13 +39,16 @@ stop slave 'master1'; ...@@ -38,13 +39,16 @@ stop slave 'master1';
--let $datadir = `SELECT @@datadir` --let $datadir = `SELECT @@datadir`
--replace_result $SERVER_MYPORT_1 MYPORT_1 let read_master_log_pos=`select $binlog_start_pos + 554`;
let relay_log_pos=`select 2*$binlog_start_pos + 594`;
let relay_log_space=`select 3*$binlog_start_pos + 652`;
--replace_result $SERVER_MYPORT_1 MYPORT_1 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space <relay_log_space>
show slave 'master1' status; show slave 'master1' status;
--list_files $datadir mysqld* --list_files $datadir mysqld*
reset slave 'master1'; reset slave 'master1';
--replace_result $SERVER_MYPORT_1 MYPORT_1 --replace_result $SERVER_MYPORT_1 MYPORT_1 $relay_log_pos <relay_log_pos> $relay_log_space <relay_log_space>
show slave 'master1' status; show slave 'master1' status;
--list_files $datadir mysqld* --list_files $datadir mysqld*
......
...@@ -11,8 +11,8 @@ include/wait_for_slave_to_start.inc ...@@ -11,8 +11,8 @@ include/wait_for_slave_to_start.inc
set default_master_connection = ''; set default_master_connection = '';
show all slaves status; show all slaves status;
Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-slave1.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000 slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave1.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000
slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000 slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
start all slaves; start all slaves;
stop slave 'slave1'; stop slave 'slave1';
show slave 'slave1' status; show slave 'slave1' status;
...@@ -22,9 +22,9 @@ Master_User root ...@@ -22,9 +22,9 @@ Master_User root
Master_Port MYPORT_1 Master_Port MYPORT_1
Connect_Retry 60 Connect_Retry 60
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 313 Read_Master_Log_Pos <read_master_log_pos>
Relay_Log_File mysqld-relay-bin-slave1.000002 Relay_Log_File mysqld-relay-bin-slave1.000002
Relay_Log_Pos 601 Relay_Log_Pos <relay_log_pos>
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
Slave_IO_Running No Slave_IO_Running No
Slave_SQL_Running No Slave_SQL_Running No
...@@ -37,8 +37,8 @@ Replicate_Wild_Ignore_Table ...@@ -37,8 +37,8 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 313 Exec_Master_Log_Pos <read_master_log_pos>
Relay_Log_Space 906 Relay_Log_Space <relay_log_space1>
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
Until_Log_Pos 0 Until_Log_Pos 0
...@@ -66,18 +66,18 @@ Parallel_Mode conservative ...@@ -66,18 +66,18 @@ Parallel_Mode conservative
reset slave 'slave1'; reset slave 'slave1';
show all slaves status; show all slaves status;
Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
slave1 127.0.0.1 root MYPORT_1 60 4 601 No No 0 0 0 906 None 0 No NULL No 0 0 1 No conservative 0 1073741824 7 0 60.000 slave1 127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space1> None 0 No NULL No 0 0 1 No conservative 0 1073741824 7 0 60.000
slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000 slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
reset slave 'slave1' all; reset slave 'slave1' all;
show all slaves status; show all slaves status;
Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 Yes Yes 0 0 313 906 None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000 slave2 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000
stop all slaves; stop all slaves;
Warnings: Warnings:
Note 1938 SLAVE 'slave2' stopped Note 1938 SLAVE 'slave2' stopped
show all slaves status; show all slaves status;
Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin-slave2.000002 601 master-bin.000001 No No 0 0 313 906 None 0 No NULL No 0 0 2 No conservative 0 1073741824 7 0 60.000 slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space1> None 0 No NULL No 0 0 2 No conservative 0 1073741824 7 0 60.000
stop all slaves; stop all slaves;
include/reset_master_slave.inc include/reset_master_slave.inc
include/reset_master_slave.inc include/reset_master_slave.inc
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# #
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/binlog_start_pos.inc
--let $rpl_server_count= 0 --let $rpl_server_count= 0
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) --connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
...@@ -40,7 +41,11 @@ let $condition = = 7; ...@@ -40,7 +41,11 @@ let $condition = = 7;
let $wait_for_all = 1; let $wait_for_all = 1;
--source include/wait_show_condition.inc --source include/wait_show_condition.inc
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 let read_master_log_pos=`select $binlog_start_pos + 65`;
let relay_log_pos=`select 2*$binlog_start_pos + 105`;
let relay_log_space1=`select 3*$binlog_start_pos + 162`;
let relay_log_space2=`select 3*$binlog_start_pos + 162`;
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status; show all slaves status;
# Ensure that start all slaves doesn't do anything as all slaves are started # Ensure that start all slaves doesn't do anything as all slaves are started
...@@ -48,19 +53,19 @@ start all slaves; ...@@ -48,19 +53,19 @@ start all slaves;
stop slave 'slave1'; stop slave 'slave1';
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 --replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
query_vertical show slave 'slave1' status; query_vertical show slave 'slave1' status;
reset slave 'slave1'; reset slave 'slave1';
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 --replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status; show all slaves status;
reset slave 'slave1' all; reset slave 'slave1' all;
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 --replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status; show all slaves status;
stop all slaves; stop all slaves;
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 --replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status; show all slaves status;
# Ensure that start all slaves doesn't do anything as all slaves are stopped # Ensure that start all slaves doesn't do anything as all slaves are stopped
......
--source include/have_udf.inc --source include/have_udf.inc
--source include/have_log_bin.inc --source include/have_log_bin.inc
--source include/binlog_start_pos.inc
--let $pos=`select $binlog_start_pos + 65`
--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1) --let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1) --let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1)
...@@ -164,8 +167,11 @@ RESET MASTER; ...@@ -164,8 +167,11 @@ RESET MASTER;
# Test RESET MASTER TO # Test RESET MASTER TO
RESET MASTER; RESET MASTER;
--replace_result $pos <pos>
SHOW MASTER STATUS; SHOW MASTER STATUS;
RESET MASTER TO 100; RESET MASTER TO 100;
--replace_result $pos <pos>
SHOW MASTER STATUS; SHOW MASTER STATUS;
RESET MASTER; RESET MASTER;
--replace_result $pos <pos>
SHOW MASTER STATUS; SHOW MASTER STATUS;
...@@ -1193,12 +1193,16 @@ DROP TABLE t1; ...@@ -1193,12 +1193,16 @@ DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mwl136.sql --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mwl136.sql
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ let $binlog_limit= 7, 3;
SHOW BINLOG EVENTS LIMIT 7,3; source include/show_binlog_events.inc;
source include/binlog_start_pos.inc;
let _BINLOG_START_POS= $binlog_start_pos;
--perl --perl
my $f= "$ENV{MYSQLTEST_VARDIR}/tmp/mwl136.sql"; my $f= "$ENV{MYSQLTEST_VARDIR}/tmp/mwl136.sql";
my $pos=$ENV{_BINLOG_START_POS} + 691;
open F, '<', $f or die "Failed to open $f: $!\n"; open F, '<', $f or die "Failed to open $f: $!\n";
while (<F>) { while (<F>) {
s/$pos/<pos>/;
print if /CHANGE MASTER TO/; print if /CHANGE MASTER TO/;
} }
EOF EOF
......
...@@ -23,8 +23,7 @@ SET use_stat_tables = PREFERABLY; ...@@ -23,8 +23,7 @@ SET use_stat_tables = PREFERABLY;
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2; CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2;
ALTER TABLE t1 ANALYZE PARTITION p1; ALTER TABLE t1 ANALYZE PARTITION p1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ source include/show_binlog_events.inc;
SHOW BINLOG EVENTS;
SET use_stat_tables = DEFAULT; SET use_stat_tables = DEFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment