/usr/share/cagefs-skeleton/usr/include/mysql/server/private
/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ /** @file Representation of an SQL command. */ #ifndef SQL_CMD_INCLUDED #define SQL_CMD_INCLUDED /* When a command is added here, be sure it's also added in mysqld.cc in "struct show_var_st status_vars[]= {" ... If the command returns a result set or is not allowed in stored functions or triggers, please also make sure that sp_get_flags_for_command (sp_head.cc) returns proper flags for the added SQLCOM_. */ enum enum_sql_command { SQLCOM_SELECT, SQLCOM_CREATE_TABLE, SQLCOM_CREATE_INDEX, SQLCOM_ALTER_TABLE, SQLCOM_UPDATE, SQLCOM_INSERT, SQLCOM_INSERT_SELECT, SQLCOM_DELETE, SQLCOM_TRUNCATE, SQLCOM_DROP_TABLE, SQLCOM_DROP_INDEX, SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS, SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_STATUS, SQLCOM_SHOW_ENGINE_LOGS, SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_MUTEX, SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_BINLOG_STAT, SQLCOM_SHOW_SLAVE_STAT, SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS, SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS, SQLCOM_SHOW_TRIGGERS, SQLCOM_LOAD,SQLCOM_SET_OPTION,SQLCOM_LOCK_TABLES,SQLCOM_UNLOCK_TABLES, SQLCOM_GRANT, SQLCOM_CHANGE_DB, SQLCOM_CREATE_DB, SQLCOM_DROP_DB, SQLCOM_ALTER_DB, SQLCOM_REPAIR, SQLCOM_REPLACE, SQLCOM_REPLACE_SELECT, SQLCOM_CREATE_FUNCTION, SQLCOM_DROP_FUNCTION, SQLCOM_REVOKE,SQLCOM_OPTIMIZE, SQLCOM_CHECK, SQLCOM_ASSIGN_TO_KEYCACHE, SQLCOM_PRELOAD_KEYS, SQLCOM_FLUSH, SQLCOM_KILL, SQLCOM_ANALYZE, SQLCOM_ROLLBACK, SQLCOM_ROLLBACK_TO_SAVEPOINT, SQLCOM_COMMIT, SQLCOM_SAVEPOINT, SQLCOM_RELEASE_SAVEPOINT, SQLCOM_SLAVE_START, SQLCOM_SLAVE_STOP, SQLCOM_BEGIN, SQLCOM_CHANGE_MASTER, SQLCOM_RENAME_TABLE, SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_PURGE_BEFORE, SQLCOM_SHOW_BINLOGS, SQLCOM_SHOW_OPEN_TABLES, SQLCOM_HA_OPEN, SQLCOM_HA_CLOSE, SQLCOM_HA_READ, SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI, SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_DO, SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS, SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES, SQLCOM_HELP, SQLCOM_CREATE_USER, SQLCOM_DROP_USER, SQLCOM_RENAME_USER, SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM, SQLCOM_CREATE_PROCEDURE, SQLCOM_CREATE_SPFUNCTION, SQLCOM_CALL, SQLCOM_DROP_PROCEDURE, SQLCOM_ALTER_PROCEDURE,SQLCOM_ALTER_FUNCTION, SQLCOM_SHOW_CREATE_PROC, SQLCOM_SHOW_CREATE_FUNC, SQLCOM_SHOW_STATUS_PROC, SQLCOM_SHOW_STATUS_FUNC, SQLCOM_PREPARE, SQLCOM_EXECUTE, SQLCOM_DEALLOCATE_PREPARE, SQLCOM_CREATE_VIEW, SQLCOM_DROP_VIEW, SQLCOM_CREATE_TRIGGER, SQLCOM_DROP_TRIGGER, SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE, SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER, SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE, SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN, SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT, SQLCOM_SHOW_PLUGINS, SQLCOM_SHOW_CONTRIBUTORS, SQLCOM_CREATE_SERVER, SQLCOM_DROP_SERVER, SQLCOM_ALTER_SERVER, SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT, SQLCOM_DROP_EVENT, SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS, SQLCOM_SHOW_CREATE_TRIGGER, SQLCOM_ALTER_DB_UPGRADE, SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES, SQLCOM_SIGNAL, SQLCOM_RESIGNAL, SQLCOM_SHOW_RELAYLOG_EVENTS, SQLCOM_GET_DIAGNOSTICS, SQLCOM_SLAVE_ALL_START, SQLCOM_SLAVE_ALL_STOP, SQLCOM_SHOW_EXPLAIN, SQLCOM_SHOW_ANALYZE, SQLCOM_SHUTDOWN, SQLCOM_CREATE_ROLE, SQLCOM_DROP_ROLE, SQLCOM_GRANT_ROLE, SQLCOM_REVOKE_ROLE, SQLCOM_COMPOUND, SQLCOM_SHOW_GENERIC, SQLCOM_ALTER_USER, SQLCOM_SHOW_CREATE_USER, SQLCOM_EXECUTE_IMMEDIATE, SQLCOM_CREATE_SEQUENCE, SQLCOM_DROP_SEQUENCE, SQLCOM_ALTER_SEQUENCE, SQLCOM_CREATE_PACKAGE, SQLCOM_DROP_PACKAGE, SQLCOM_CREATE_PACKAGE_BODY, SQLCOM_DROP_PACKAGE_BODY, SQLCOM_SHOW_CREATE_PACKAGE, SQLCOM_SHOW_CREATE_PACKAGE_BODY, SQLCOM_SHOW_STATUS_PACKAGE, SQLCOM_SHOW_STATUS_PACKAGE_BODY, SQLCOM_SHOW_PACKAGE_BODY_CODE, SQLCOM_BACKUP, SQLCOM_BACKUP_LOCK, /* When a command is added here, be sure it's also added in mysqld.cc in "struct show_var_st com_status_vars[]= {" ... */ /* This should be the last !!! */ SQLCOM_END }; class Storage_engine_name { protected: LEX_CSTRING m_storage_engine_name; public: Storage_engine_name() { m_storage_engine_name.str= NULL; m_storage_engine_name.length= 0; } Storage_engine_name(const LEX_CSTRING &name) :m_storage_engine_name(name) { } Storage_engine_name(const LEX_STRING &name) { m_storage_engine_name.str= name.str; m_storage_engine_name.length= name.length; } bool resolve_storage_engine_with_error(THD *thd, handlerton **ha, bool tmp_table); bool is_set() { return m_storage_engine_name.str != NULL; } const LEX_CSTRING *name() const { return &m_storage_engine_name; } }; /** @class Sql_cmd - Representation of an SQL command. This class is an interface between the parser and the runtime. The parser builds the appropriate derived classes of Sql_cmd to represent a SQL statement in the parsed tree. The execute() method in the derived classes of Sql_cmd contain the runtime implementation. Note that this interface is used for SQL statements recently implemented, the code for older statements tend to load the LEX structure with more attributes instead. Implement new statements by sub-classing Sql_cmd, as this improves code modularity (see the 'big switch' in dispatch_command()), and decreases the total size of the LEX structure (therefore saving memory in stored programs). The recommended name of a derived class of Sql_cmd is Sql_cmd_<derived>. Notice that the Sql_cmd class should not be confused with the Statement class. Statement is a class that is used to manage an SQL command or a set of SQL commands. When the SQL statement text is analyzed, the parser will create one or more Sql_cmd objects to represent the actual SQL commands. */ class Sql_cmd : public Sql_alloc { private: Sql_cmd(const Sql_cmd &); // No copy constructor wanted void operator=(Sql_cmd &); // No assignment operator wanted public: /** @brief Return the command code for this statement */ virtual enum_sql_command sql_command_code() const = 0; /** Execute this SQL statement. @param thd the current thread. @retval false on success. @retval true on error */ virtual bool execute(THD *thd) = 0; virtual Storage_engine_name *option_storage_engine_name() { return NULL; } protected: Sql_cmd() = default; virtual ~Sql_cmd() { /* Sql_cmd objects are allocated in thd->mem_root. In MySQL, the C++ destructor is never called, the underlying MEM_ROOT is simply destroyed instead. Do not rely on the destructor for any cleanup. */ DBUG_ASSERT(FALSE); } }; class Sql_cmd_show_slave_status: public Sql_cmd { protected: bool show_all_slaves_status; public: Sql_cmd_show_slave_status() :show_all_slaves_status(false) {} Sql_cmd_show_slave_status(bool status_all) :show_all_slaves_status(status_all) {} enum_sql_command sql_command_code() const override { return SQLCOM_SHOW_SLAVE_STAT; } bool execute(THD *thd) override; bool is_show_all_slaves_stat() { return show_all_slaves_status; } }; class Sql_cmd_create_table_like: public Sql_cmd, public Storage_engine_name { public: Storage_engine_name *option_storage_engine_name() override { return this; } bool execute(THD *thd) override; }; class Sql_cmd_create_table: public Sql_cmd_create_table_like { public: enum_sql_command sql_command_code() const override { return SQLCOM_CREATE_TABLE; } }; class Sql_cmd_create_sequence: public Sql_cmd_create_table_like { public: enum_sql_command sql_command_code() const override { return SQLCOM_CREATE_SEQUENCE; } }; /** Sql_cmd_call represents the CALL statement. */ class Sql_cmd_call : public Sql_cmd { public: class sp_name *m_name; const class Sp_handler *m_handler; Sql_cmd_call(class sp_name *name, const class Sp_handler *handler) :m_name(name), m_handler(handler) {} virtual ~Sql_cmd_call() = default; /** Execute a CALL statement at runtime. @param thd the current thread. @return false on success. */ bool execute(THD *thd) override; enum_sql_command sql_command_code() const override { return SQLCOM_CALL; } }; #endif // SQL_CMD_INCLUDED
.
Edit
..
Edit
aligned.h
Edit
aria_backup.h
Edit
assume_aligned.h
Edit
atomic
Edit
authors.h
Edit
backup.h
Edit
bounded_queue.h
Edit
client_settings.h
Edit
compat56.h
Edit
config.h
Edit
contributors.h
Edit
create_options.h
Edit
create_tmp_table.h
Edit
cset_narrowing.h
Edit
custom_conf.h
Edit
data
Edit
datadict.h
Edit
ddl_log.h
Edit
debug.h
Edit
debug_sync.h
Edit
derived_handler.h
Edit
derror.h
Edit
des_key_file.h
Edit
discover.h
Edit
dur_prop.h
Edit
embedded_priv.h
Edit
event_data_objects.h
Edit
event_db_repository.h
Edit
event_parse_data.h
Edit
event_queue.h
Edit
event_scheduler.h
Edit
events.h
Edit
field.h
Edit
field_comp.h
Edit
filesort.h
Edit
filesort_utils.h
Edit
ft_global.h
Edit
gcalc_slicescan.h
Edit
gcalc_tools.h
Edit
grant.h
Edit
group_by_handler.h
Edit
gstream.h
Edit
ha_handler_stats.h
Edit
ha_partition.h
Edit
ha_sequence.h
Edit
handle_connections_win.h
Edit
handler.h
Edit
hash.h
Edit
hash_filo.h
Edit
heap.h
Edit
hostname.h
Edit
ilist.h
Edit
init.h
Edit
innodb_priv.h
Edit
item.h
Edit
item_cmpfunc.h
Edit
item_create.h
Edit
item_func.h
Edit
item_geofunc.h
Edit
item_jsonfunc.h
Edit
item_row.h
Edit
item_strfunc.h
Edit
item_subselect.h
Edit
item_sum.h
Edit
item_timefunc.h
Edit
item_vers.h
Edit
item_windowfunc.h
Edit
item_xmlfunc.h
Edit
json_table.h
Edit
key.h
Edit
keycaches.h
Edit
lex.h
Edit
lex_charset.h
Edit
lex_hash.h
Edit
lex_ident.h
Edit
lex_string.h
Edit
lex_symbol.h
Edit
lex_token.h
Edit
lf.h
Edit
lock.h
Edit
log.h
Edit
log_event.h
Edit
log_event_data_type.h
Edit
log_event_old.h
Edit
log_slow.h
Edit
maria.h
Edit
mariadb.h
Edit
mdl.h
Edit
mem_root_array.h
Edit
message.h
Edit
multi_range_read.h
Edit
my_alarm.h
Edit
my_apc.h
Edit
my_atomic.h
Edit
my_atomic_wrapper.h
Edit
my_base.h
Edit
my_bit.h
Edit
my_bitmap.h
Edit
my_check_opt.h
Edit
my_compare.h
Edit
my_counter.h
Edit
my_cpu.h
Edit
my_crypt.h
Edit
my_decimal.h
Edit
my_default.h
Edit
my_handler_errors.h
Edit
my_json_writer.h
Edit
my_libwrap.h
Edit
my_md5.h
Edit
my_minidump.h
Edit
my_nosys.h
Edit
my_rdtsc.h
Edit
my_rnd.h
Edit
my_service_manager.h
Edit
my_stack_alloc.h
Edit
my_stacktrace.h
Edit
my_time.h
Edit
my_tree.h
Edit
my_uctype.h
Edit
my_user.h
Edit
my_virtual_mem.h
Edit
myisam.h
Edit
myisamchk.h
Edit
myisammrg.h
Edit
myisampack.h
Edit
mysqld.h
Edit
mysqld_default_groups.h
Edit
mysqld_suffix.h
Edit
mysys_err.h
Edit
opt_histogram_json.h
Edit
opt_range.h
Edit
opt_subselect.h
Edit
opt_trace.h
Edit
opt_trace_context.h
Edit
parse_file.h
Edit
partition_element.h
Edit
partition_info.h
Edit
password.h
Edit
pfs_file_provider.h
Edit
pfs_idle_provider.h
Edit
pfs_memory_provider.h
Edit
pfs_metadata_provider.h
Edit
pfs_socket_provider.h
Edit
pfs_stage_provider.h
Edit
pfs_statement_provider.h
Edit
pfs_table_provider.h
Edit
pfs_thread_provider.h
Edit
pfs_transaction_provider.h
Edit
privilege.h
Edit
probes_mysql.h
Edit
probes_mysql_dtrace.h
Edit
probes_mysql_nodtrace.h
Edit
procedure.h
Edit
protocol.h
Edit
providers
Edit
proxy_protocol.h
Edit
queues.h
Edit
records.h
Edit
repl_failsafe.h
Edit
replication.h
Edit
rijndael.h
Edit
rowid_filter.h
Edit
rpl_constants.h
Edit
rpl_filter.h
Edit
rpl_gtid.h
Edit
rpl_injector.h
Edit
rpl_mi.h
Edit
rpl_parallel.h
Edit
rpl_record.h
Edit
rpl_record_old.h
Edit
rpl_reporting.h
Edit
rpl_rli.h
Edit
rpl_tblmap.h
Edit
rpl_utility.h
Edit
scheduler.h
Edit
scope.h
Edit
select_handler.h
Edit
semisync.h
Edit
semisync_master.h
Edit
semisync_master_ack_receiver.h
Edit
semisync_slave.h
Edit
service_versions.h
Edit
session_tracker.h
Edit
set_var.h
Edit
slave.h
Edit
socketpair.h
Edit
source_revision.h
Edit
sp.h
Edit
sp_cache.h
Edit
sp_head.h
Edit
sp_pcontext.h
Edit
sp_rcontext.h
Edit
span.h
Edit
spatial.h
Edit
sql_acl.h
Edit
sql_admin.h
Edit
sql_alloc.h
Edit
sql_alter.h
Edit
sql_analyse.h
Edit
sql_analyze_stmt.h
Edit
sql_array.h
Edit
sql_audit.h
Edit
sql_base.h
Edit
sql_basic_types.h
Edit
sql_binlog.h
Edit
sql_bitmap.h
Edit
sql_bootstrap.h
Edit
sql_cache.h
Edit
sql_callback.h
Edit
sql_class.h
Edit
sql_cmd.h
Edit
sql_connect.h
Edit
sql_const.h
Edit
sql_crypt.h
Edit
sql_cte.h
Edit
sql_cursor.h
Edit
sql_db.h
Edit
sql_debug.h
Edit
sql_delete.h
Edit
sql_derived.h
Edit
sql_digest.h
Edit
sql_digest_stream.h
Edit
sql_do.h
Edit
sql_error.h
Edit
sql_explain.h
Edit
sql_expression_cache.h
Edit
sql_get_diagnostics.h
Edit
sql_handler.h
Edit
sql_help.h
Edit
sql_hset.h
Edit
sql_i_s.h
Edit
sql_insert.h
Edit
sql_join_cache.h
Edit
sql_lex.h
Edit
sql_lifo_buffer.h
Edit
sql_limit.h
Edit
sql_list.h
Edit
sql_load.h
Edit
sql_locale.h
Edit
sql_manager.h
Edit
sql_mode.h
Edit
sql_parse.h
Edit
sql_partition.h
Edit
sql_partition_admin.h
Edit
sql_plist.h
Edit
sql_plugin.h
Edit
sql_plugin_compat.h
Edit
sql_prepare.h
Edit
sql_priv.h
Edit
sql_profile.h
Edit
sql_reload.h
Edit
sql_rename.h
Edit
sql_repl.h
Edit
sql_schema.h
Edit
sql_select.h
Edit
sql_sequence.h
Edit
sql_servers.h
Edit
sql_show.h
Edit
sql_signal.h
Edit
sql_sort.h
Edit
sql_statistics.h
Edit
sql_string.h
Edit
sql_table.h
Edit
sql_test.h
Edit
sql_time.h
Edit
sql_trigger.h
Edit
sql_truncate.h
Edit
sql_tvc.h
Edit
sql_type.h
Edit
sql_type_fixedbin.h
Edit
sql_type_fixedbin_storage.h
Edit
sql_type_geom.h
Edit
sql_type_int.h
Edit
sql_type_json.h
Edit
sql_type_real.h
Edit
sql_type_string.h
Edit
sql_udf.h
Edit
sql_union.h
Edit
sql_update.h
Edit
sql_view.h
Edit
sql_window.h
Edit
ssl_compat.h
Edit
strfunc.h
Edit
structs.h
Edit
sys_vars_shared.h
Edit
t_ctype.h
Edit
table.h
Edit
table_cache.h
Edit
thr_alarm.h
Edit
thr_lock.h
Edit
thr_malloc.h
Edit
thr_timer.h
Edit
thread_cache.h
Edit
threadpool.h
Edit
threadpool_generic.h
Edit
threadpool_winsockets.h
Edit
transaction.h
Edit
tzfile.h
Edit
tztime.h
Edit
uniques.h
Edit
unireg.h
Edit
vers_string.h
Edit
violite.h
Edit
waiting_threads.h
Edit
welcome_copyright_notice.h
Edit
win_tzname_data.h
Edit
winservice.h
Edit
wqueue.h
Edit
wsrep.h
Edit
wsrep_allowlist_service.h
Edit
wsrep_applier.h
Edit
wsrep_binlog.h
Edit
wsrep_client_service.h
Edit
wsrep_client_state.h
Edit
wsrep_condition_variable.h
Edit
wsrep_high_priority_service.h
Edit
wsrep_mutex.h
Edit
wsrep_mysqld.h
Edit
wsrep_mysqld_c.h
Edit
wsrep_on.h
Edit
wsrep_priv.h
Edit
wsrep_schema.h
Edit
wsrep_server_service.h
Edit
wsrep_server_state.h
Edit
wsrep_sst.h
Edit
wsrep_status.h
Edit
wsrep_storage_service.h
Edit
wsrep_thd.h
Edit
wsrep_trans_observer.h
Edit
wsrep_types.h
Edit
wsrep_utils.h
Edit
wsrep_var.h
Edit
wsrep_xid.h
Edit
xa.h
Edit