00001 /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB & Sasha 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 #include "rpl_filter.h" 00018 00019 #ifdef HAVE_REPLICATION 00020 #include "slave.h" 00021 00022 typedef struct st_slave_info 00023 { 00024 uint32 server_id; 00025 uint32 rpl_recovery_rank, master_id; 00026 char host[HOSTNAME_LENGTH+1]; 00027 char user[USERNAME_LENGTH+1]; 00028 char password[MAX_PASSWORD_LENGTH+1]; 00029 uint16 port; 00030 THD* thd; 00031 } SLAVE_INFO; 00032 00033 extern my_bool opt_show_slave_auth_info; 00034 extern char *master_host, *master_info_file; 00035 extern bool server_id_supplied; 00036 00037 extern int max_binlog_dump_events; 00038 extern my_bool opt_sporadic_binlog_dump_fail; 00039 00040 #define KICK_SLAVE(thd) do { \ 00041 pthread_mutex_lock(&(thd)->LOCK_delete); \ 00042 (thd)->awake(THD::NOT_KILLED); \ 00043 pthread_mutex_unlock(&(thd)->LOCK_delete); \ 00044 } while(0) 00045 00046 int start_slave(THD* thd, MASTER_INFO* mi, bool net_report); 00047 int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report); 00048 bool change_master(THD* thd, MASTER_INFO* mi); 00049 bool mysql_show_binlog_events(THD* thd); 00050 int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1, 00051 const char* log_file_name2, ulonglong log_pos2); 00052 int reset_slave(THD *thd, MASTER_INFO* mi); 00053 int reset_master(THD* thd); 00054 bool purge_master_logs(THD* thd, const char* to_log); 00055 bool purge_master_logs_before_date(THD* thd, time_t purge_time); 00056 bool log_in_use(const char* log_name); 00057 void adjust_linfo_offsets(my_off_t purge_offset); 00058 bool show_binlogs(THD* thd); 00059 extern int init_master_info(MASTER_INFO* mi); 00060 void kill_zombie_dump_threads(uint32 slave_server_id); 00061 int check_binlog_magic(IO_CACHE* log, const char** errmsg); 00062 00063 typedef struct st_load_file_info 00064 { 00065 THD* thd; 00066 my_off_t last_pos_in_file; 00067 bool wrote_create_file, log_delayed; 00068 } LOAD_FILE_INFO; 00069 00070 int log_loaded_block(IO_CACHE* file); 00071 00072 #endif /* HAVE_REPLICATION */ 00073
1.4.7

