3 # Print status information for replication, typically used to debug
6 # The following is printed on the current connection:
8 # SELECT NOW(), @@SERVER_ID, @@SERVER_UUID
12 # SHOW BINLOG EVENTS IN <binlog_name>
14 # Where <binlog_name> is the currently active binlog.
16 # Then, the same is printed from all connections configured by
17 # rpl_init.inc - i.e., on connection server_N, where
18 # 1 <= N <= $rpl_server_count
23 # [--let $rpl_only_current_connection= 1]
24 # --source include/show_rpl_debug_info.inc
27 # $rpl_only_current_connection
28 # By default, debug info is printed from all connections, starting
29 # with the current connection. If this variable is set, debug
30 # info is printed only for the current connection.
33 # ==== Side effects ====
35 # Turns on enable_query_log, enable_result_log, enable_warnings,
36 # horizontal_results, and enable_abort_on_error.
38 # Prints non-deterministic output to the query log. This file should
39 # never be called in a test that does not fail.
46 --disable_abort_on_error
50 --let $_rpl_old_con= $CURRENT_CONNECTION
51 --let $_rpl_is_first_server= 1
52 --let $_rpl_server= $rpl_server_count
53 if ($_rpl_server ==
'')
59 --echo CURRENT_CONNECTION =
'$_rpl_old_con'
63 if (!$_rpl_is_first_server)
65 --connection server_$_rpl_server
69 --echo ############################## $CURRENT_CONNECTION ##############################
71 --echo **** SHOW WARNINGS on $CURRENT_CONNECTION ****
74 --echo **** SELECT replication-related variables on $CURRENT_CONNECTION ****
75 query_vertical SELECT NOW(), @@SERVER_ID, @@SERVER_UUID, @@PORT;
77 --echo **** GTID_* on $CURRENT_CONNECTION ****
79 SELECT @@GLOBAL.GTID_EXECUTED, @@GLOBAL.GTID_PURGED, @@GLOBAL.GTID_OWNED, @@SESSION.GTID_EXECUTED, @@SESSION.GTID_OWNED;
81 --echo **** SHOW SLAVE
STATUS on $CURRENT_CONNECTION ****
82 query_vertical SHOW SLAVE
STATUS;
84 --echo **** SHOW MASTER STATUS on $CURRENT_CONNECTION ****
85 query_vertical SHOW MASTER STATUS;
87 --echo **** SHOW SLAVE HOSTS on $CURRENT_CONNECTION ****
88 query_vertical SHOW SLAVE HOSTS;
90 --echo **** SHOW PROCESSLIST on $CURRENT_CONNECTION ****
93 --echo **** SHOW BINARY LOGS on $CURRENT_CONNECTION ****
96 --echo **** SHOW BINLOG EVENTS on $CURRENT_CONNECTION ****
97 let $binlog_name= query_get_value(
"SHOW MASTER STATUS", File, 1);
98 --echo binlog_name =
'$binlog_name'
99 eval SHOW BINLOG EVENTS IN
'$binlog_name';
101 --echo **** SHOW RELAYLOG EVENTS on $CURRENT_CONNECTION ****
102 let $relaylog_name= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
103 --echo relaylog_name =
'$relaylog_name'
104 eval SHOW RELAYLOG EVENTS IN
'$relaylog_name';
106 --echo **** slave_relay_info on $CURRENT_CONNECTION ****
107 SELECT * FROM mysql.slave_relay_log_info;
109 --echo **** slave_master_info on $CURRENT_CONNECTION ****
110 SELECT * FROM mysql.slave_master_info;
112 --let $_rpl_is_first_server= 0
114 # Don't use same connection twice.
115 if (`SELECT
'server_$_rpl_server' =
'$_rpl_old_con'`)
118 if ($rpl_only_current_connection)
120 --let $_rpl_server= 0
125 --echo rand_seed:
'$rand_seed' _rand_state:
'$_rand_state'
126 --echo
extra debug info
if any:
'$extra_debug_info'
128 --connection $_rpl_old_con
129 --enable_abort_on_error