1 /* Copyright (C) 2013 Codership Oy <info@codership.com>
2 
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License as published by
5    the Free Software Foundation; version 2 of the License.
6 
7    This program is distributed in the hope that it will be useful,
8    but WITHOUT ANY WARRANTY; without even the implied warranty of
9    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10    GNU General Public License for more details.
11 
12    You should have received a copy of the GNU General Public License along
13    with this program; if not, write to the Free Software Foundation, Inc.,
14    51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA. */
15 
16 #include <my_config.h>
17 
18 #ifndef WSREP_VAR_H
19 #define WSREP_VAR_H
20 
21 #ifdef WITH_WSREP
22 
23 #define WSREP_CLUSTER_NAME        "my_wsrep_cluster"
24 #define WSREP_NODE_INCOMING_AUTO  "AUTO"
25 #define WSREP_START_POSITION_ZERO "00000000-0000-0000-0000-000000000000:-1"
26 
27 // MySQL variables funcs
28 
29 #include "sql_priv.h"
30 #include <sql_plugin.h>
31 #include <mysql/plugin.h>
32 
33 class sys_var;
34 class set_var;
35 class THD;
36 
37 int wsrep_init_vars();
38 
39 #define CHECK_ARGS   (sys_var *self, THD* thd, set_var *var)
40 #define UPDATE_ARGS  (sys_var *self, THD* thd, enum_var_type type)
41 #define DEFAULT_ARGS (THD* thd, enum_var_type var_type)
42 #define INIT_ARGS    (const char* opt)
43 
44 extern bool wsrep_causal_reads_update        UPDATE_ARGS;
45 extern bool wsrep_on_check                   CHECK_ARGS;
46 extern bool wsrep_on_update                  UPDATE_ARGS;
47 extern bool wsrep_sync_wait_update           UPDATE_ARGS;
48 extern bool wsrep_start_position_check       CHECK_ARGS;
49 extern bool wsrep_start_position_update      UPDATE_ARGS;
50 extern bool wsrep_start_position_init        INIT_ARGS;
51 
52 extern bool wsrep_provider_check             CHECK_ARGS;
53 extern bool wsrep_provider_update            UPDATE_ARGS;
54 extern void wsrep_provider_init              INIT_ARGS;
55 
56 extern bool wsrep_provider_options_check     CHECK_ARGS;
57 extern bool wsrep_provider_options_update    UPDATE_ARGS;
58 extern void wsrep_provider_options_init      INIT_ARGS;
59 
60 extern bool wsrep_cluster_address_check      CHECK_ARGS;
61 extern bool wsrep_cluster_address_update     UPDATE_ARGS;
62 extern void wsrep_cluster_address_init       INIT_ARGS;
63 
64 extern bool wsrep_cluster_name_check         CHECK_ARGS;
65 extern bool wsrep_cluster_name_update        UPDATE_ARGS;
66 
67 extern bool wsrep_node_name_check            CHECK_ARGS;
68 extern bool wsrep_node_name_update           UPDATE_ARGS;
69 
70 extern bool wsrep_node_address_check         CHECK_ARGS;
71 extern bool wsrep_node_address_update        UPDATE_ARGS;
72 extern void wsrep_node_address_init          INIT_ARGS;
73 
74 extern bool wsrep_sst_method_check           CHECK_ARGS;
75 extern bool wsrep_sst_method_update          UPDATE_ARGS;
76 extern void wsrep_sst_method_init            INIT_ARGS;
77 
78 extern bool wsrep_sst_receive_address_check  CHECK_ARGS;
79 extern bool wsrep_sst_receive_address_update UPDATE_ARGS;
80 
81 extern bool wsrep_sst_auth_check             CHECK_ARGS;
82 extern bool wsrep_sst_auth_update            UPDATE_ARGS;
83 
84 extern bool wsrep_sst_donor_check            CHECK_ARGS;
85 extern bool wsrep_sst_donor_update           UPDATE_ARGS;
86 
87 extern bool wsrep_slave_threads_check        CHECK_ARGS;
88 extern bool wsrep_slave_threads_update       UPDATE_ARGS;
89 
90 extern bool wsrep_desync_check               CHECK_ARGS;
91 extern bool wsrep_desync_update              UPDATE_ARGS;
92 
93 extern bool wsrep_max_ws_size_check          CHECK_ARGS;
94 extern bool wsrep_max_ws_size_update         UPDATE_ARGS;
95 extern bool wsrep_reject_queries_update      UPDATE_ARGS;
96 
97 #else  /* WITH_WSREP */
98 
99 #define WSREP_NONE
100 #define wsrep_provider_init(X)
101 #define wsrep_init_vars() (0)
102 #define wsrep_start_position_init(X)
103 
104 #endif /* WITH_WSREP */
105 #endif /* WSREP_VAR_H */
106