MXS-1343: send hostname to master with COM_REGISTER_SLAVE

A new option ‘slave_hostname’ allows the setting of hostname in
COM_REGISTER_SLAVE.

SHOW SLAVES HOSTS; in master server can show the hostname set in binlog
router:

MariaDB [(none)]> SHOW SLAVE HOSTS;
+-----------+-----------------------------+------+-----------+
| Server_id | Host                        | Port | Master_id |
+-----------+-----------------------------+------+-----------+
|        93 | maxscale-blr-1.mydomain.net | 8808 |     10124 |
+-----------+-----------------------------+------+-----------+
This commit is contained in:
MassimilianoPinto
2017-08-09 17:09:50 +02:00
parent e409927d6c
commit 7da092843f
3 changed files with 52 additions and 12 deletions

View File

@ -592,6 +592,7 @@ typedef struct router_instance
int master_semi_sync; /*< Semi-Sync replication status of master server */
BINLOG_ENCRYPTION_SETUP encryption; /*< Binlog encryption setup */
void *encryption_ctx; /*< Encryption context */
char *set_slave_hostname; /*< Send custom Hostname to Master */
struct router_instance *next;
} ROUTER_INSTANCE;