2000-10-01 21:28:21 -06:00
|
|
|
#ifndef SQL_REPL_H
|
|
|
|
#define SQL_REPL_H
|
|
|
|
|
2000-11-11 14:50:39 -07:00
|
|
|
#include "slave.h"
|
|
|
|
|
2001-05-30 18:50:56 -06:00
|
|
|
typedef struct st_slave_info
|
|
|
|
{
|
|
|
|
uint32 server_id;
|
2001-10-23 13:28:03 -06:00
|
|
|
uint32 rpl_recovery_rank, master_id;
|
2001-05-30 18:50:56 -06:00
|
|
|
char host[HOSTNAME_LENGTH+1];
|
|
|
|
char user[USERNAME_LENGTH+1];
|
|
|
|
char password[HASH_PASSWORD_LENGTH+1];
|
|
|
|
uint16 port;
|
2001-10-12 09:37:25 -06:00
|
|
|
THD* thd;
|
2001-05-30 18:50:56 -06:00
|
|
|
} SLAVE_INFO;
|
|
|
|
|
2001-08-03 15:57:53 -06:00
|
|
|
extern bool opt_show_slave_auth_info, opt_old_rpl_compat;
|
2000-10-01 21:28:21 -06:00
|
|
|
extern char* master_host;
|
|
|
|
extern my_string opt_bin_logname, master_info_file;
|
2000-12-08 12:50:57 -07:00
|
|
|
extern uint32 server_id;
|
|
|
|
extern bool server_id_supplied;
|
2000-10-01 21:28:21 -06:00
|
|
|
extern I_List<i_string> binlog_do_db, binlog_ignore_db;
|
|
|
|
|
2001-06-28 18:22:29 -06:00
|
|
|
#ifndef DBUG_OFF
|
|
|
|
extern int max_binlog_dump_events;
|
|
|
|
extern bool opt_sporadic_binlog_dump_fail;
|
|
|
|
#endif
|
|
|
|
|
2002-01-19 19:16:52 -07:00
|
|
|
#define KICK_SLAVE(thd) thd->awake(0 /* do not prepare to die*/);
|
2001-11-10 22:24:12 -07:00
|
|
|
|
2001-04-24 17:39:26 -06:00
|
|
|
File open_binlog(IO_CACHE *log, const char *log_file_name,
|
|
|
|
const char **errmsg);
|
|
|
|
|
2002-01-19 19:16:52 -07:00
|
|
|
int start_slave(THD* thd, MASTER_INFO* mi, bool net_report);
|
|
|
|
int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report);
|
|
|
|
int change_master(THD* thd, MASTER_INFO* mi);
|
2001-06-21 13:19:24 -06:00
|
|
|
int show_binlog_events(THD* thd);
|
2001-07-04 17:14:31 -06:00
|
|
|
int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
|
|
|
|
const char* log_file_name2, ulonglong log_pos2);
|
2002-01-19 19:16:52 -07:00
|
|
|
int reset_slave(MASTER_INFO* mi);
|
|
|
|
int reset_master(THD* thd);
|
2000-10-26 22:11:55 -06:00
|
|
|
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);
|
2000-10-01 21:28:21 -06:00
|
|
|
extern int init_master_info(MASTER_INFO* mi);
|
|
|
|
void kill_zombie_dump_threads(uint32 slave_server_id);
|
2002-01-19 19:16:52 -07:00
|
|
|
int check_binlog_magic(IO_CACHE* log, const char** errmsg);
|
2000-10-01 21:28:21 -06:00
|
|
|
|
2001-08-03 15:57:53 -06:00
|
|
|
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);
|
|
|
|
|
2000-10-01 21:28:21 -06:00
|
|
|
#endif
|
2001-08-03 15:57:53 -06:00
|
|
|
|