1 | #ifndef REPL_FAILSAFE_INCLUDED |
2 | #define REPL_FAILSAFE_INCLUDED |
3 | |
4 | /* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. |
5 | |
6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; version 2 of the License. |
9 | |
10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
18 | |
19 | #ifdef HAVE_REPLICATION |
20 | |
21 | #include "mysql.h" |
22 | #include <my_sys.h> |
23 | #include "slave.h" |
24 | |
25 | typedef enum {RPL_AUTH_MASTER=0,RPL_IDLE_SLAVE,RPL_ACTIVE_SLAVE, |
26 | RPL_LOST_SOLDIER,RPL_TROOP_SOLDIER, |
27 | RPL_RECOVERY_CAPTAIN,RPL_NULL /* inactive */, |
28 | RPL_ANY /* wild card used by change_rpl_status */ } RPL_STATUS; |
29 | extern ulong rpl_status; |
30 | |
31 | extern mysql_mutex_t LOCK_rpl_status; |
32 | extern mysql_cond_t COND_rpl_status; |
33 | extern TYPELIB rpl_role_typelib; |
34 | extern const char* rpl_role_type[], *rpl_status_type[]; |
35 | |
36 | void change_rpl_status(ulong from_status, ulong to_status); |
37 | int find_recovery_captain(THD* thd, MYSQL* mysql); |
38 | |
39 | extern HASH slave_list; |
40 | |
41 | bool show_slave_hosts(THD* thd); |
42 | void init_slave_list(); |
43 | void end_slave_list(); |
44 | int register_slave(THD* thd, uchar* packet, size_t packet_length); |
45 | void unregister_slave(THD* thd, bool only_mine, bool need_mutex); |
46 | |
47 | #endif /* HAVE_REPLICATION */ |
48 | #endif /* REPL_FAILSAFE_INCLUDED */ |
49 | |