143
143
#define SLAVE_FORCE_ALL 4
145
int32_t init_slave();
146
146
void init_slave_skip_errors(const char* arg);
147
147
bool flush_relay_log_info(Relay_log_info* rli);
148
int register_slave_on_master(MYSQL* mysql);
149
int terminate_slave_threads(Master_info* mi, int thread_mask,
148
int32_t register_slave_on_master(MYSQL* mysql);
149
int32_t terminate_slave_threads(Master_info* mi, int32_t thread_mask,
150
150
bool skip_lock = 0);
151
int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
151
int32_t start_slave_threads(bool need_slave_mutex, bool wait_for_start,
152
152
Master_info* mi, const char* master_info_fname,
153
const char* slave_info_fname, int thread_mask);
153
const char* slave_info_fname, int32_t thread_mask);
155
155
cond_lock is usually same as start_lock. It is needed for the case when
156
156
start_lock is 0 which happens if start_slave_thread() is called already
157
157
inside the start_lock section, but at the same time we want a
158
158
pthread_cond_wait() on start_cond,start_lock
160
int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock,
160
int32_t start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock,
161
161
pthread_mutex_t *cond_lock,
162
162
pthread_cond_t* start_cond,
163
volatile uint *slave_running,
164
volatile ulong *slave_run_id,
163
volatile uint32_t *slave_running,
164
volatile uint32_t *slave_run_id,
166
166
bool high_priority);
168
168
/* If fd is -1, dump to NET */
169
int mysql_table_dump(THD* thd, const char* db,
170
const char* tbl_name, int fd = -1);
169
int32_t mysql_table_dump(THD* thd, const char* db,
170
const char* tbl_name, int32_t fd = -1);
172
172
/* retrieve table from master and copy to slave*/
173
int fetch_master_table(THD* thd, const char* db_name, const char* table_name,
173
int32_t fetch_master_table(THD* thd, const char* db_name, const char* table_name,
174
174
Master_info* mi, MYSQL* mysql, bool overwrite);
176
176
bool show_master_info(THD* thd, Master_info* mi);
177
177
bool show_binlog_info(THD* thd);
178
bool rpl_master_has_bug(Relay_log_info *rli, uint bug_id, bool report= true);
178
bool rpl_master_has_bug(Relay_log_info *rli, uint32_t bug_id, bool report= true);
179
179
bool rpl_master_erroneous_autoinc(THD* thd);
181
181
const char *print_slave_db_safe(const char *db);
182
int check_expected_error(THD* thd, Relay_log_info const *rli, int error_code);
182
int32_t check_expected_error(THD* thd, Relay_log_info const *rli, int32_t error_code);
183
183
void skip_load_data_infile(NET* net);
185
185
void end_slave(); /* clean up */
188
188
void end_relay_log_info(Relay_log_info* rli);
189
189
void lock_slave_threads(Master_info* mi);
190
190
void unlock_slave_threads(Master_info* mi);
191
void init_thread_mask(int* mask,Master_info* mi,bool inverse);
192
int init_relay_log_pos(Relay_log_info* rli,const char* log,ulonglong pos,
191
void init_thread_mask(int32_t* mask,Master_info* mi,bool inverse);
192
int32_t init_relay_log_pos(Relay_log_info* rli,const char* log,uint64_t pos,
193
193
bool need_data_lock, const char** errmsg,
194
194
bool look_for_description_event);
196
int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
196
int32_t purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
197
197
const char** errmsg);
198
198
void set_slave_thread_options(THD* thd);
199
199
void set_slave_thread_default_charset(THD *thd, Relay_log_info const *rli);
200
200
void rotate_relay_log(Master_info* mi);
201
int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli,
201
int32_t apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli,
204
204
pthread_handler_t handle_slave_io(void *arg);
208
208
extern LIST master_list;
209
209
extern my_bool replicate_same_server_id;
211
extern int disconnect_slave_event_count, abort_slave_event_count ;
211
extern int32_t disconnect_slave_event_count, abort_slave_event_count ;
213
213
/* the master variables are defaults read from my.cnf or command line */
214
extern uint master_port, master_connect_retry, report_port;
214
extern uint32_t master_port, master_connect_retry, report_port;
215
215
extern char * master_user, *master_password, *master_host;
216
216
extern char *master_info_file, *relay_log_info_file, *report_user;
217
217
extern char *report_host, *report_password;