The world's most popular open source database
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 #ifdef HAVE_REPLICATION 00018 00019 #include "mysql.h" 00020 #include "my_sys.h" 00021 #include "slave.h" 00022 00023 typedef enum {RPL_AUTH_MASTER=0,RPL_ACTIVE_SLAVE,RPL_IDLE_SLAVE, 00024 RPL_LOST_SOLDIER,RPL_TROOP_SOLDIER, 00025 RPL_RECOVERY_CAPTAIN,RPL_NULL /* inactive */, 00026 RPL_ANY /* wild card used by change_rpl_status */ } RPL_STATUS; 00027 extern RPL_STATUS rpl_status; 00028 00029 extern pthread_mutex_t LOCK_rpl_status; 00030 extern pthread_cond_t COND_rpl_status; 00031 extern TYPELIB rpl_role_typelib, rpl_status_typelib; 00032 extern const char* rpl_role_type[], *rpl_status_type[]; 00033 00034 pthread_handler_t handle_failsafe_rpl(void *arg); 00035 void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status); 00036 int find_recovery_captain(THD* thd, MYSQL* mysql); 00037 int update_slave_list(MYSQL* mysql, MASTER_INFO* mi); 00038 00039 extern HASH slave_list; 00040 00041 bool load_master_data(THD* thd); 00042 int connect_to_master(THD *thd, MYSQL* mysql, MASTER_INFO* mi); 00043 00044 bool show_new_master(THD* thd); 00045 bool show_slave_hosts(THD* thd); 00046 int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg); 00047 void init_slave_list(); 00048 void end_slave_list(); 00049 int register_slave(THD* thd, uchar* packet, uint packet_length); 00050 void unregister_slave(THD* thd, bool only_mine, bool need_mutex); 00051 00052 #endif /* HAVE_REPLICATION */
1.4.7

