WL#5789: Replication master interface

Affects: Server-Prototype Only   —   Status: On-Hold   —   Priority: Medium

This is a step towards making replication a library, such that the 5.6 rpl-lib can 
be plugged into the 5.5 core [WL#5675].

In this worklog, we define an interface for the replication master. We only create 
a class that groups together the functions that the core server needs in order to 
execute master-related commands. The interface will contain all functions we need, 
but the function prototypes will not be in their final form. In particular, 
unstable structs such as THD will be passed as parameters. In future worklogs, we 
will change the function prototypes.
We define the class Master. It has the following class functions:

init: Initialize data for replication master when library is loaded.

end: Cleanup when replication library is unloaded.

register_slave: Handle COM_REGISTER_SLAVE request from slave.

binlog_dump: Handle COM_BINLOG_DUMP command.

show_slave_hosts: Execute SHOW SLAVE HOSTS command.

Note: in a previous version of this worklog, RESET MASTER and SHOW MASTER STATUS 
were part of the master interface. However, those are actually binlog maintenance 
commands, so they will be part of the Binlog interface [WL#5778].
class Master {
  int init();
  void end();
  int register_slave(THD* thd, unsigned int packet_length, char* packet);
  int show_slave_hosts(THD* thd);
  int binlog_dump(THD* thd, unsigned int packet_length, char* packet);