1#ifndef SQL_SERVERS_INCLUDED
2#define SQL_SERVERS_INCLUDED
Definition: sql_servers.h:36
FOREIGN_SERVER()
Definition: sql_servers.h:43
char * sport
Definition: sql_servers.h:41
char * password
Definition: sql_servers.h:41
char * server_name
Definition: sql_servers.h:38
char * scheme
Definition: sql_servers.h:41
char * owner
Definition: sql_servers.h:41
size_t server_name_length
Definition: sql_servers.h:40
char * socket
Definition: sql_servers.h:41
char * host
Definition: sql_servers.h:41
char * username
Definition: sql_servers.h:41
long port
Definition: sql_servers.h:39
char * db
Definition: sql_servers.h:41
This class represent server options as set by the parser.
Definition: sql_servers.h:70
void set_scheme(LEX_STRING scheme)
Definition: sql_servers.h:91
LEX_STRING m_password
Definition: sql_servers.h:80
const char * get_host() const
Definition: sql_servers.h:96
static const long PORT_NOT_SET
Definition: sql_servers.h:72
void store_new_server(TABLE *table) const
Create a record representing these server options, ready to be inserted into the mysql....
Definition: sql_servers.cc:592
const char * get_scheme() const
Definition: sql_servers.h:100
void set_host(LEX_STRING host)
Definition: sql_servers.h:87
void set_socket(LEX_STRING socket)
Definition: sql_servers.h:92
void reset()
Reset all strings to NULL and port to PORT_NOT_SET.
Definition: sql_servers.cc:461
void set_port(long port)
Definition: sql_servers.h:86
const char * get_password() const
Definition: sql_servers.h:99
void set_db(LEX_STRING db)
Definition: sql_servers.h:88
const char * get_socket() const
Definition: sql_servers.h:101
LEX_STRING m_socket
Definition: sql_servers.h:82
LEX_STRING m_host
Definition: sql_servers.h:77
LEX_STRING m_username
Definition: sql_servers.h:79
void store_altered_server(TABLE *table, FOREIGN_SERVER *existing) const
Create a record for updating a row in the mysql.servers table.
Definition: sql_servers.cc:625
bool insert_into_cache() const
Create a cache entry and insert it into the cache.
Definition: sql_servers.cc:481
void set_username(LEX_STRING username)
Definition: sql_servers.h:89
void set_owner(LEX_STRING owner)
Definition: sql_servers.h:93
LEX_STRING m_db
Definition: sql_servers.h:78
LEX_STRING m_server_name
Definition: sql_servers.h:73
const char * get_owner() const
Definition: sql_servers.h:102
long m_port
Definition: sql_servers.h:76
const char * get_db() const
Definition: sql_servers.h:97
bool update_cache(FOREIGN_SERVER *existing) const
Update a cache entry.
Definition: sql_servers.cc:527
void set_password(LEX_STRING password)
Definition: sql_servers.h:90
LEX_STRING m_scheme
Definition: sql_servers.h:81
const char * get_username() const
Definition: sql_servers.h:98
long get_port() const
Definition: sql_servers.h:95
LEX_STRING m_owner
Definition: sql_servers.h:83
This class implements the ALTER SERVER statement.
Definition: sql_servers.h:201
const Server_options * m_server_options
Server_options::m_server_name contains the name of the server to change.
Definition: sql_servers.h:208
Sql_cmd_alter_server(Server_options *server_options)
Definition: sql_servers.h:211
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_servers.h:214
bool execute(THD *thd) override
Alter an existing server by updating the matching row in the mysql.servers table and updating the cac...
Definition: sql_servers.cc:745
This class has common code for CREATE/ALTER/DROP SERVER statements.
Definition: sql_servers.h:147
TABLE * table
Definition: sql_servers.h:149
Sql_cmd_common_server()
Definition: sql_servers.h:151
~Sql_cmd_common_server() override=default
bool check_and_open_table(THD *thd)
Check permissions and open the mysql.servers table.
Definition: sql_servers.cc:642
This class implements the CREATE SERVER statement.
Definition: sql_servers.h:169
bool execute(THD *thd) override
Create a new server by inserting a row into the mysql.server table and creating a cache entry.
Definition: sql_servers.cc:677
Sql_cmd_create_server(Server_options *server_options)
Definition: sql_servers.h:179
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_servers.h:182
const Server_options * m_server_options
Server_options::m_server_name contains the name of the server to create.
Definition: sql_servers.h:176
This class implements the DROP SERVER statement.
Definition: sql_servers.h:233
bool execute(THD *thd) override
Drop an existing server by deleting the matching row from the mysql.servers table and removing the ca...
Definition: sql_servers.cc:822
Sql_cmd_drop_server(LEX_STRING server_name, bool if_exists)
Definition: sql_servers.h:241
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_servers.h:246
bool m_if_exists
Is this DROP IF EXISTS?
Definition: sql_servers.h:238
LEX_STRING m_server_name
Name of server to drop.
Definition: sql_servers.h:235
Representation of an SQL command.
Definition: sql_cmd.h:64
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
enum_sql_command
Definition: my_sqlcommand.h:45
@ SQLCOM_ALTER_SERVER
Definition: my_sqlcommand.h:167
@ SQLCOM_DROP_SERVER
Definition: my_sqlcommand.h:166
@ SQLCOM_CREATE_SERVER
Definition: my_sqlcommand.h:165
static char * password
Definition: mysql_secure_installation.cc:55
const char * host
Definition: mysqladmin.cc:58
stdx::expected< native_handle_type, error_type > socket(int family, int sock_type, int protocol)
Definition: socket.h:62
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:191
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:32
Representation of an SQL command.
static MEM_ROOT mem
Definition: sql_servers.cc:98
FOREIGN_SERVER * get_server_by_name(MEM_ROOT *mem, const char *server_name, FOREIGN_SERVER *server_buffer)
Definition: sql_servers.cc:938
void servers_free(bool end=false)
Definition: sql_servers.cc:880
bool servers_init(THD *thd)
Definition: sql_servers.cc:190
bool servers_reload(THD *thd)
Definition: sql_servers.cc:283
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82
Definition: mysql_lex_string.h:34
char * str
Definition: mysql_lex_string.h:35