1#ifndef SQL_SERVERS_INCLUDED
2#define SQL_SERVERS_INCLUDED
3
4/* Copyright (c) 2006, 2010, 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#include "slave.h" // for tables_ok(), rpl_filter
20
21class THD;
22typedef struct st_lex_server_options LEX_SERVER_OPTIONS;
23typedef struct st_mem_root MEM_ROOT;
24
25/* structs */
26typedef struct st_federated_server
27{
28 const char *server_name;
29 long port;
30 size_t server_name_length;
31 const char *db, *scheme, *username, *password, *socket, *owner, *host, *sport;
32} FOREIGN_SERVER;
33
34/* cache handlers */
35bool servers_init(bool dont_read_server_table);
36bool servers_reload(THD *thd);
37void servers_free(bool end=0);
38
39/* insert functions */
40int create_server(THD *thd, LEX_SERVER_OPTIONS *server_options);
41
42/* drop functions */
43int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options);
44
45/* update functions */
46int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options);
47
48/* lookup functions */
49FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name,
50 FOREIGN_SERVER *server_buffer);
51
52#endif /* SQL_SERVERS_INCLUDED */
53