Confirmed with MariaDB 10.0.1, If @@default_master_connection will be null, it will not show result in "show slave status \G"
mysql> \s
--------------
mysql Ver 14.14 Distrib 5.6.22-71.0, for debian-linux-gnu (x86_64) using EditLine wrapper
...
Server version: 5.5.5-10.0.15-MariaDB-log MariaDB Server
mysql> select @@default_master_connection;
+-----------------------------+
| @@default_master_connection |
+-----------------------------+
| |
+-----------------------------+
1 row in set (0.00 sec)
mysql> show slave status \G
Empty set (0.00 sec)
mysql> show all slaves status\G
*************************** 1. row *************************** Connection_name: master1 Slave_SQL_State: Slave has read all relay log; waiting for the slave I/O thread to update it Slave_IO_State: Waiting for master to send event Master_Host: 127.0.0.1 Master_User: rsandbox Master_Port: 24025 Connect_Retry: 60 Master_Log_File: mysql-bin.000002 Read_Master_Log_Pos: 326 Relay_Log_File: mysql_sandbox24026-relay-bin-master1.000004 Relay_Log_Pos: 535 Relay_Master_Log_File: mysql-bin.000002 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 326 Relay_Log_Space: 853 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error:
Replicate_Ignore_Server_Ids: Master_Server_Id: 1 Master_SSL_Crl: Master_SSL_Crlpath: Using_Gtid: No Gtid_IO_Pos: Retried_transactions: 0 Max_relay_log_size: 1073741824 Executed_log_entries: 6
Slave_received_heartbeats: 0 Slave_heartbeat_period: 1800.000 Gtid_Slave_Pos: 0-1-12
*************************** 2. row *************************** Connection_name: master2 Slave_SQL_State: Slave has read all relay log; waiting for the slave I/O thread to update it Slave_IO_State: Waiting for master to send event Master_Host: 127.0.0.1 Master_User: rsandbox Master_Port: 24027 Connect_Retry: 60 Master_Log_File: mysql-bin.000002 Read_Master_Log_Pos: 312 Relay_Log_File: mysql_sandbox24026-relay-bin-master2.000004 Relay_Log_Pos: 535 Relay_Master_Log_File: mysql-bin.000002 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 312 Relay_Log_Space: 853 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error:
Replicate_Ignore_Server_Ids: Master_Server_Id: 102 Master_SSL_Crl: Master_SSL_Crlpath: Using_Gtid: No Gtid_IO_Pos: Retried_transactions: 0 Max_relay_log_size: 1073741824 Executed_log_entries: 6
Slave_received_heartbeats: 0 Slave_heartbeat_period: 1800.000 Gtid_Slave_Pos: 0-1-12
2 rows in set (0.00 sec)
But if @@default_master_connection is set. i.e
mysql> select @@default_master_connection;
+-----------------------------+
| @@default_master_connection |
+-----------------------------+
| master1 |
+-----------------------------+
1 row in set (0.00 sec)
mysql> show slave status \G
*************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: 127.0.0.1 Master_User: rsandbox Master_Port: 24025 Connect_Retry: 60 Master_Log_File: mysql-bin.000002 Read_Master_Log_Pos: 326 Relay_Log_File: mysql_sandbox24026-relay-bin-master1.000004 Relay_Log_Pos: 535 Relay_Master_Log_File: mysql-bin.000002 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 326 Relay_Log_Space: 853 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error:
Replicate_Ignore_Server_Ids: Master_Server_Id: 1 Master_SSL_Crl: Master_SSL_Crlpath: Using_Gtid: No Gtid_IO_Pos:
1 row in set (0.00 sec)
mysql>
Then show slave status will show the output but only for default master.
Confirmed with MariaDB 10.0.1, If @@default_ master_ connection will be null, it will not show result in "show slave status \G"
mysql> \s 0.15-MariaDB- log MariaDB Server
--------------
mysql Ver 14.14 Distrib 5.6.22-71.0, for debian-linux-gnu (x86_64) using EditLine wrapper
...
Server version: 5.5.5-10.
mysql> select @@default_ master_ connection; ------- ------- ------- --+ master_ connection | ------- ------- ------- --+ ------- ------- ------- --+
+------
| @@default_
+------
| |
+------
1 row in set (0.00 sec)
mysql> show slave status \G
Empty set (0.00 sec)
mysql> show all slaves status\G ******* ******* ****** 1. row ******* ******* ******* ******
Connection_ name: master1
Slave_SQL_ State: Slave has read all relay log; waiting for the slave I/O thread to update it
Slave_ IO_State: Waiting for master to send event
Master_ Host: 127.0.0.1
Master_ User: rsandbox
Master_ Port: 24025
Connect_ Retry: 60
Master_ Log_File: mysql-bin.000002
Read_ Master_ Log_Pos: 326
Relay_ Log_File: mysql_sandbox24 026-relay- bin-master1. 000004
Relay_ Log_Pos: 535
Relay_ Master_ Log_File: mysql-bin.000002
Slave_ IO_Running: Yes
Slave_ SQL_Running: Yes
Replicate_ Do_DB:
Replicate_ Ignore_ DB:
Replicate_ Do_Table:
Replicate_ Ignore_ Table: _Wild_Do_ Table: Wild_Ignore_ Table:
Last_ Errno: 0
Last_ Error:
Skip_ Counter: 0
Exec_ Master_ Log_Pos: 326
Relay_Log_ Space: 853
Until_Condition : None
Until_ Log_File:
Until_ Log_Pos: 0
Master_ SSL_Allowed: No
Master_ SSL_CA_ File:
Master_ SSL_CA_ Path:
Master_ SSL_Cert:
Master_ SSL_Cipher:
Master_ SSL_Key:
Seconds_ Behind_ Master: 0 SSL_Verify_ Server_ Cert: No
Last_ IO_Errno: 0
Last_ IO_Error:
Last_SQL_ Errno: 0
Last_SQL_ Error: Ignore_ Server_ Ids:
Master_ Server_ Id: 1
Master_ SSL_Crl:
Master_ SSL_Crlpath:
Using_ Gtid: No
Gtid_ IO_Pos:
Retried_ transactions: 0
Max_ relay_log_ size: 1073741824
Executed_ log_entries: 6 received_ heartbeats: 0
Slave_heartbeat _period: 1800.000
Gtid_Slave_ Pos: 0-1-12 ******* ******* ****** 2. row ******* ******* ******* ******
Connection_ name: master2
Slave_SQL_ State: Slave has read all relay log; waiting for the slave I/O thread to update it
Slave_ IO_State: Waiting for master to send event
Master_ Host: 127.0.0.1
Master_ User: rsandbox
Master_ Port: 24027
Connect_ Retry: 60
Master_ Log_File: mysql-bin.000002
Read_ Master_ Log_Pos: 312
Relay_ Log_File: mysql_sandbox24 026-relay- bin-master2. 000004
Relay_ Log_Pos: 535
Relay_ Master_ Log_File: mysql-bin.000002
Slave_ IO_Running: Yes
Slave_ SQL_Running: Yes
Replicate_ Do_DB:
Replicate_ Ignore_ DB:
Replicate_ Do_Table:
Replicate_ Ignore_ Table: _Wild_Do_ Table: Wild_Ignore_ Table:
Last_ Errno: 0
Last_ Error:
Skip_ Counter: 0
Exec_ Master_ Log_Pos: 312
Relay_Log_ Space: 853
Until_Condition : None
Until_ Log_File:
Until_ Log_Pos: 0
Master_ SSL_Allowed: No
Master_ SSL_CA_ File:
Master_ SSL_CA_ Path:
Master_ SSL_Cert:
Master_ SSL_Cipher:
Master_ SSL_Key:
Seconds_ Behind_ Master: 0 SSL_Verify_ Server_ Cert: No
Last_ IO_Errno: 0
Last_ IO_Error:
Last_SQL_ Errno: 0
Last_SQL_ Error: Ignore_ Server_ Ids:
Master_ Server_ Id: 102
Master_ SSL_Crl:
Master_ SSL_Crlpath:
Using_ Gtid: No
Gtid_ IO_Pos:
Retried_ transactions: 0
Max_ relay_log_ size: 1073741824
Executed_ log_entries: 6 received_ heartbeats: 0
Slave_heartbeat _period: 1800.000
Gtid_Slave_ Pos: 0-1-12
*******
Replicate
Replicate_
Master_
Replicate_
Slave_
*******
Replicate
Replicate_
Master_
Replicate_
Slave_
2 rows in set (0.00 sec)
But if @@default_ master_ connection is set. i.e
mysql> select @@default_ master_ connection; ------- ------- ------- --+ master_ connection | ------- ------- ------- --+ ------- ------- ------- --+
+------
| @@default_
+------
| master1 |
+------
1 row in set (0.00 sec)
mysql> show slave status \G ******* ******* ****** 1. row ******* ******* ******* ******
Slave_ IO_State: Waiting for master to send event
Master_ Host: 127.0.0.1
Master_ User: rsandbox
Master_ Port: 24025
Connect_ Retry: 60
Master_ Log_File: mysql-bin.000002
Read_ Master_ Log_Pos: 326
Relay_ Log_File: mysql_sandbox24 026-relay- bin-master1. 000004
Relay_ Log_Pos: 535
Relay_ Master_ Log_File: mysql-bin.000002
Slave_ IO_Running: Yes
Slave_ SQL_Running: Yes
Replicate_ Do_DB:
Replicate_ Ignore_ DB:
Replicate_ Do_Table:
Replicate_ Ignore_ Table: _Wild_Do_ Table: Wild_Ignore_ Table:
Last_ Errno: 0
Last_ Error:
Skip_ Counter: 0
Exec_ Master_ Log_Pos: 326
Relay_Log_ Space: 853
Until_Condition : None
Until_ Log_File:
Until_ Log_Pos: 0
Master_ SSL_Allowed: No
Master_ SSL_CA_ File:
Master_ SSL_CA_ Path:
Master_ SSL_Cert:
Master_ SSL_Cipher:
Master_ SSL_Key:
Seconds_ Behind_ Master: 0 SSL_Verify_ Server_ Cert: No
Last_ IO_Errno: 0
Last_ IO_Error:
Last_SQL_ Errno: 0
Last_SQL_ Error: Ignore_ Server_ Ids:
Master_ Server_ Id: 1
Master_ SSL_Crl:
Master_ SSL_Crlpath:
Using_ Gtid: No
Gtid_ IO_Pos:
*******
Replicate
Replicate_
Master_
Replicate_
1 row in set (0.00 sec)
mysql>
Then show slave status will show the output but only for default master.