3
3
# Print status information for replication, typically used to debug
6
# First, the following is printed on slave:
6
# The following is printed on the current connection:
10
12
# SHOW BINLOG EVENTS IN <binlog_name>
12
14
# Where <binlog_name> is the currently active binlog.
14
# Then, the following is printed on master:
18
# SHOW BINLOG EVENTS IN <sql_binlog_name>
19
# SHOW BINLOG EVENTS IN <io_binlog_name>
21
# Where <sql_binlog_name> is the binlog name that the slave sql thread
22
# is currently reading from and <io_binlog_name> is the binlog that
23
# the slave IO thread is currently reading from.
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
27
# [let $master_connection= <connection>;]
28
# source include/show_rpl_debug_info.inc;
30
# If $master_connection is set, debug info will be retrieved from the
31
# connection named $master_connection. Otherwise, it will be
32
# retrieved from the 'master' connection if the current connection is
35
let $_con= $CURRENT_CONNECTION;
39
--echo **** SHOW SLAVE STATUS on $_con ****
40
query_vertical SHOW SLAVE STATUS;
42
--echo **** SHOW PROCESSLIST on $_con ****
45
--echo **** SHOW BINLOG EVENTS on $_con ****
46
let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
47
eval SHOW BINLOG EVENTS IN '$binlog_name';
49
let $_master_con= $master_connection;
50
if (`SELECT '$_master_con' = ''`)
52
if (`SELECT '$_con' = 'slave'`)
54
let $_master_con= master;
56
if (`SELECT '$_master_con' = ''`)
58
--echo Unable to determine master connection. No debug info printed for master.
59
--echo Please fix the test case by setting $master_connection before sourcing
60
--echo show_rpl_debug_info.inc.
64
if (`SELECT '$_master_con' != ''`)
67
let $master_binlog_name_io= query_get_value("SHOW SLAVE STATUS", Master_Log_File, 1);
68
let $master_binlog_name_sql= query_get_value("SHOW SLAVE STATUS", Relay_Master_Log_File, 1);
70
--echo [on $_master_con]
71
connection $_master_con;
73
--echo **** SHOW MASTER STATUS on $_master_con ****
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.
45
--disable_abort_on_error
49
--let $_rpl_old_con= $CURRENT_CONNECTION
50
--let $_rpl_is_first_server= 1
51
--let $_rpl_server= $rpl_server_count
57
if (!$_rpl_is_first_server)
59
--connection server_$_rpl_server
63
--echo ############################## $CURRENT_CONNECTION ##############################
65
--echo **** SHOW WARNINGS on $CURRENT_CONNECTION ****
68
--echo **** SELECT replication-related variables on $CURRENT_CONNECTION ****
69
SELECT NOW(), @@SERVER_ID;
71
--echo **** SHOW SLAVE STATUS on $CURRENT_CONNECTION ****
72
query_vertical SHOW SLAVE STATUS;
74
--echo **** SHOW MASTER STATUS on $CURRENT_CONNECTION ****
74
75
query_vertical SHOW MASTER STATUS;
76
--echo **** SHOW PROCESSLIST on $_master_con ****
77
--echo **** SHOW SLAVE HOSTS on $CURRENT_CONNECTION ****
78
query_vertical SHOW SLAVE HOSTS;
80
--echo **** SHOW PROCESSLIST on $CURRENT_CONNECTION ****
79
--echo **** SHOW BINLOG EVENTS on $_master_con ****
80
eval SHOW BINLOG EVENTS IN '$master_binlog_name_sql';
81
if (`SELECT '$master_binlog_name_io' != '$master_binlog_name_sql'`)
83
--echo **** SHOW BINARY LOGS on $CURRENT_CONNECTION ****
86
--echo **** SHOW BINLOG EVENTS on $CURRENT_CONNECTION ****
87
let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
88
--echo binlog_name = '$binlog_name'
89
eval SHOW BINLOG EVENTS IN '$binlog_name';
92
--let $_rpl_is_first_server= 0
94
# Don't use same connection twice.
95
if (`SELECT 'server_$_rpl_server' = '$_rpl_old_con'`)
83
eval SHOW BINLOG EVENTS IN '$master_binlog_name_io';
98
if ($rpl_only_current_connection)
100
--let $_rpl_server= 0
105
--connection $_rpl_old_con
106
--enable_abort_on_error