sql_repl.h 1.96 KB
Newer Older
1 2 3
#ifndef SQL_REPL_H
#define SQL_REPL_H

4 5
#include "slave.h"

6 7 8 9 10 11 12
typedef struct st_slave_info
{
  uint32 server_id;
  char host[HOSTNAME_LENGTH+1];
  char user[USERNAME_LENGTH+1];
  char password[HASH_PASSWORD_LENGTH+1];
  uint16 port;
unknown's avatar
unknown committed
13
  THD* thd;
14 15
} SLAVE_INFO;

16
extern bool opt_show_slave_auth_info, opt_old_rpl_compat;
17
extern HASH slave_list;
18 19
extern char* master_host;
extern my_string opt_bin_logname, master_info_file;
unknown's avatar
unknown committed
20 21
extern uint32 server_id;
extern bool server_id_supplied;
22 23
extern I_List<i_string> binlog_do_db, binlog_ignore_db;

24 25 26 27 28
#ifndef DBUG_OFF
extern int max_binlog_dump_events;
extern bool opt_sporadic_binlog_dump_fail;
#endif

29 30 31
File open_binlog(IO_CACHE *log, const char *log_file_name,
	      const char **errmsg);

32 33
int start_slave(THD* thd = 0, bool net_report = 1);
int stop_slave(THD* thd = 0, bool net_report = 1);
34 35
int load_master_data(THD* thd);
int connect_to_master(THD *thd, MYSQL* mysql, MASTER_INFO* mi);
36
int change_master(THD* thd);
unknown's avatar
unknown committed
37
int show_new_master(THD* thd);
38
int show_slave_hosts(THD* thd);
unknown's avatar
unknown committed
39
int show_binlog_events(THD* thd);
unknown's avatar
unknown committed
40 41 42
int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg);
int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
		   const char* log_file_name2, ulonglong log_pos2);
43 44
void reset_slave();
void reset_master();
45 46 47
void init_slave_list();
void end_slave_list();
int register_slave(THD* thd, uchar* packet, uint packet_length);
unknown's avatar
unknown committed
48
void unregister_slave(THD* thd, bool only_mine, bool need_mutex);
unknown's avatar
unknown committed
49 50 51 52
int purge_master_logs(THD* thd, const char* to_log);
bool log_in_use(const char* log_name);
void adjust_linfo_offsets(my_off_t purge_offset);
int show_binlogs(THD* thd);
53 54 55
extern int init_master_info(MASTER_INFO* mi);
void kill_zombie_dump_threads(uint32 slave_server_id);

56 57 58 59 60 61 62 63 64 65 66 67 68 69
typedef struct st_load_file_info
{
  THD* thd;
  sql_exchange* ex;
  List <Item> *fields;
  enum enum_duplicates handle_dup;
  char* db;
  char* table_name;
  bool wrote_create_file;
  my_off_t last_pos_in_file;
} LOAD_FILE_INFO;

int log_loaded_block(IO_CACHE* file);

70
#endif
71