23#ifndef SQL_PARSE_INCLUDED
24#define SQL_PARSE_INCLUDED
102bool alloc_query(
THD *thd,
const char *packet,
size_t packet_length);
111 const char **index_file_name,
299#define CF_CHANGES_DATA (1U << 0)
301#define CF_STATUS_COMMAND (1U << 2)
302#define CF_SHOW_TABLE_COMMAND (1U << 3)
303#define CF_WRITE_LOGS_COMMAND (1U << 4)
317#define CF_REEXECUTION_FRAGILE (1U << 5)
329#define CF_IMPLICIT_COMMIT_BEGIN (1U << 6)
340#define CF_IMPLICIT_COMMIT_END (1U << 7)
347#define CF_AUTO_COMMIT_TRANS (CF_IMPLICIT_COMMIT_BEGIN | CF_IMPLICIT_COMMIT_END)
357#define CF_DIAGNOSTIC_STMT (1U << 8)
363#define CF_CAN_GENERATE_ROW_EVENTS (1U << 9)
369#define CF_PREOPEN_TMP_TABLES (1U << 10)
375#define CF_HA_CLOSE (1U << 11)
380#define CF_CAN_BE_EXPLAINED (1U << 12)
383#define CF_OPTIMIZER_TRACE (1U << 14)
389#define CF_DISALLOW_IN_RO_TRANS (1U << 15)
394#define CF_ALLOW_PROTOCOL_PLUGIN (1U << 16)
410#define CF_NEEDS_AUTOCOMMIT_OFF (1U << 17)
415#define CF_HAS_RESULT_SET (1U << 18)
427#define CF_POTENTIAL_ATOMIC_DDL (1U << 19)
433#define CF_REQUIRE_ACL_CACHE (1U << 20)
438#define CF_SHOW_USES_SYSTEM_VIEW (1U << 21)
449#define CF_SKIP_QUERY_ID (1U << 0)
457#define CF_SKIP_QUESTIONS (1U << 1)
Map from enumeration values of type enum_server_command to descriptions of type std::string.
Definition: sql_parse.h:144
static constexpr terminology_use_previous::enum_compatibility_version m_replace_version
The version when the name was changed.
Definition: sql_parse.h:170
static enum_server_command int_to_cmd(int cmd)
Cast an integer to enum_server_command, and assert it is in range.
Definition: sql_parse.h:189
static constexpr enum_server_command m_replace_com
Command whose name depends on @terminology_use_previous.
Definition: sql_parse.h:161
static const std::string & str_notranslate(int cmd)
Return a description string for an integer that is the numeric value of an enum_server_command.
Definition: sql_parse.h:218
static const std::string & str_notranslate(enum_server_command cmd)
Return a description string for a given enum_server_command.
Definition: sql_parse.h:205
static const std::string & str_session(int cmd)
Return a description string for an integer that is the numeric value of an enum_server_command.
Definition: sql_parse.h:254
Abstract factory interface for creating comparison predicates.
Definition: item_cmpfunc.h:522
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:853
Object_creation_ctx – interface for creation context of database objects (views, stored routines,...
Definition: table.h:198
Internal state of the parser.
Definition: sql_lexer_parser_state.h:43
Simple intrusive linked list.
Definition: sql_list.h:45
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
Definition: sql_lex.h:294
int test_if_data_home_dir(const char *dir)
Definition: sql_parse.cc:6999
bool check_host_name(const LEX_CSTRING &str)
Check that host name string is valid.
Definition: sql_parse.cc:7038
int mysql_execute_command(THD *thd, bool first_level=false)
Execute command saved in thd and lex->sql_command.
Definition: sql_parse.cc:2989
void execute_init_command(THD *thd, LEX_STRING *init_command, mysql_rwlock_t *var_lock)
Definition: sql_parse.cc:1210
void statement_id_to_session(THD *thd)
Definition: sql_parse.cc:5295
void add_to_list(SQL_I_List< ORDER > &list, ORDER *order)
save order by and tables in own lists.
Definition: sql_parse.cc:5720
bool is_log_table_write_query(enum enum_sql_command command)
Check if a sql command is allowed to write to log tables.
Definition: sql_parse.cc:1190
bool mysql_test_parse_for_slave(THD *thd)
Usable by the replication SQL thread only: just parse a query to know if it can be ignored because of...
Definition: sql_parse.cc:5510
bool all_tables_not_ok(THD *thd, Table_ref *tables)
Returns true if all tables should be ignored.
Definition: sql_parse.cc:292
bool prepare_index_and_data_dir_path(THD *thd, const char **data_file_name, const char **index_file_name, const char *table_name)
prepares the index and data directory path.
Definition: sql_parse.cc:6663
bool shutdown(THD *thd, enum mysql_enum_shutdown_level level)
Shutdown the mysqld server.
Definition: sql_parse.cc:2591
Comp_creator * comp_equal_creator(bool invert)
Definition: sql_parse.cc:6737
bool do_command(THD *thd)
Read one command from connection and execute it (query or simple command).
Definition: sql_parse.cc:1315
Comp_creator * comp_le_creator(bool invert)
Definition: sql_parse.cc:6750
bool is_normal_transaction_boundary_stmt(enum enum_sql_command command)
This function checks if the sql_command is one that identifies the boundaries (begin,...
Definition: sql_parse.cc:299
Comp_creator * comp_eq_creator(bool invert)
Definition: sql_parse.cc:6733
bool is_xa_transaction_boundary_stmt(enum enum_sql_command command)
This function checks if the sql_command is one that identifies the boundaries (begin,...
Definition: sql_parse.cc:314
bool is_explainable_query(enum enum_sql_command command)
Definition: sql_parse.cc:1180
bool show_precheck(THD *thd, LEX *lex, bool lock)
Do special checking for SHOW statements.
Definition: sql_parse.cc:5145
bool stmt_causes_implicit_commit(const THD *thd, uint mask)
Returns whether the command in thd->lex->sql_command should cause an implicit commit.
Definition: sql_parse.cc:402
const CHARSET_INFO * get_bin_collation(const CHARSET_INFO *cs)
Definition: sql_parse.cc:6495
bool sqlcom_can_generate_row_events(enum enum_sql_command command)
Definition: sql_parse.cc:1171
bool set_default_charset(HA_CREATE_INFO *create_info, const CHARSET_INFO *value)
Definition: parse_tree_nodes.cc:2174
bool some_non_temp_table_to_be_updated(THD *thd, Table_ref *tables)
Definition: sql_parse.cc:377
bool merge_sp_var_charset_and_collation(const CHARSET_INFO *charset, const CHARSET_INFO *collation, const CHARSET_INFO **to)
Definition: sql_parse.cc:7342
int append_file_to_dir(THD *thd, const char **filename_ptr, const char *table_name)
If pointer is not a null pointer, append filename to it.
Definition: sql_parse.cc:6703
LEX_USER * create_default_definer(THD *thd)
Create default definer for the specified THD.
Definition: sql_parse.cc:6869
Comp_creator * comp_gt_creator(bool invert)
Definition: sql_parse.cc:6746
bool alloc_query(THD *thd, const char *packet, size_t packet_length)
Read query from packet and store in thd->query.
Definition: sql_parse.cc:2710
void bind_fields(Item *first)
Bind Item fields to Field objects.
Definition: sql_parse.cc:1299
void create_table_set_open_action_and_adjust_tables(LEX *lex)
Set proper open mode and table type for element representing target table of CREATE TABLE statement,...
Definition: sql_parse.cc:6798
Comp_creator * comp_ne_creator(bool invert)
Definition: sql_parse.cc:6758
void turn_parser_debug_on()
int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, enum enum_schema_tables schema_table_idx)
Create a Table_ref object for an INFORMATION_SCHEMA table.
Definition: sql_parse.cc:2648
void add_join_on(Table_ref *b, Item *expr)
Add an ON condition to the second operand of a JOIN ... ON.
Definition: sql_parse.cc:6478
Comp_creator * comp_lt_creator(bool invert)
Definition: sql_parse.cc:6754
void mysql_reset_thd_for_next_command(THD *thd)
Reset the part of THD responsible for the state of command processing.
Definition: sql_parse.cc:5208
void killall_non_super_threads(THD *thd)
Definition: sql_parse.cc:6644
bool parse_sql(THD *thd, Parser_state *parser_state, Object_creation_ctx *creation_ctx)
Transform an SQL statement into an AST that is ready for resolving, using the supplied parser state a...
Definition: sql_parse.cc:7139
bool dispatch_command(THD *thd, const COM_DATA *com_data, enum enum_server_command command)
Perform one connection-level (COM_XXXX) command.
Definition: sql_parse.cc:1730
LEX_USER * get_current_user(THD *thd, LEX_USER *user)
Returns information about user or current user.
Definition: sql_parse.cc:6891
bool is_update_query(enum enum_sql_command command)
Definition: sql_parse.cc:1175
Comp_creator * comp_ge_creator(bool invert)
Definition: sql_parse.cc:6742
void dispatch_sql_command(THD *thd, Parser_state *parser_state)
Parse an SQL command from a text string and pass the resulting AST to the query executor.
Definition: sql_parse.cc:5316
uint sql_command_flags[]
Mark all commands that somehow changes a table.
Definition: sql_parse.cc:503
void init_sql_command_flags(void)
Definition: sql_parse.cc:506
void get_default_definer(THD *thd, LEX_USER *definer)
Set the specified definer to the default value, which is the current user in the thread.
Definition: sql_parse.cc:6826
bool set_default_collation(HA_CREATE_INFO *create_info, const CHARSET_INFO *value)
Definition: parse_tree_nodes.cc:2198
bool merge_charset_and_collation(const CHARSET_INFO *charset, const CHARSET_INFO *collation, const CHARSET_INFO **to)
(end of group Runtime_Environment)
Definition: sql_parse.cc:7328
void free_items(Item *item)
Definition: sql_parse.cc:1276
void cleanup_items(Item *item)
This works because items are allocated with (*THR_MALLOC)->Alloc().
Definition: sql_parse.cc:1289
bool push_new_name_resolution_context(Parse_context *pc, Table_ref *left_op, Table_ref *right_op)
Push a new name resolution context for a JOIN ... ON clause to the context stack of a query block.
Definition: sql_parse.cc:6450
bool check_string_char_length(const LEX_CSTRING &str, const char *err_msg, size_t max_char_length, const CHARSET_INFO *cs, bool no_error)
Definition: sql_parse.cc:6970
static const std::string & str_session(enum_server_command cmd)
Return a description string for a given enum_server_command.
Definition: sql_parse.cc:269
static const std::string & str_global(enum_server_command cmd)
Return a description string for a given enum_server_command.
Definition: sql_parse.cc:275
static const std::string m_replace_str
Name to use when compatibility is enabled.
Definition: sql_parse.h:165
static const std::string & translate(const System_variables &sysvars)
Given a system_variable object, returns the string to use for m_replace_com, according to the setting...
Definition: sql_parse.cc:260
static const std::string m_names[]
Array indexed by enum_server_command, where each element is a description string.
Definition: sql_parse.h:150
mysql_enum_shutdown_level
We want levels to be in growing order of hardness (because we use number comparisons).
Definition: mysql_com.h:1003
A better implementation of the UNIX ctype(3) library.
static mi_bit_type mask[]
Definition: mi_packrec.cc:140
enum_server_command
A list of all MySQL protocol commands.
Definition: my_command.h:47
@ COM_END
Not a real command.
Definition: my_command.h:100
@ COM_REGISTER_SLAVE
Definition: my_command.h:73
enum_sql_command
Definition: my_sqlcommand.h:45
Common definition between mysql server & client.
char * user
Definition: mysqladmin.cc:64
const char * collation
Definition: audit_api_message_emit.cc:183
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1063
const std::string charset("charset")
Definition: commit_order_queue.h:33
std::string dir
Double write files location.
Definition: buf0dblwr.cc:76
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:78
const char * table_name
Definition: rules_table_service.cc:55
enum_compatibility_version
Enumeration holding the possible values for @terminology_use_previous.
Definition: terminology_use_previous_enum.h:47
@ BEFORE_8_0_26
Use names that were in use up to 8.0.25, inclusive.
Definition: terminology_use_previous_enum.h:51
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2877
enum_schema_tables
Definition: handler.h:913
Definition: m_ctype.h:422
Struct to hold information about the table that should be created.
Definition: handler.h:3091
The LEX object currently serves three different purposes:
Definition: sql_lex.h:3714
Definition: mysql_lex_string.h:39
Definition: mysql_lex_string.h:34
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:418
Definition: system_variables.h:202
An instrumented rwlock structure.
Definition: mysql_rwlock_bits.h:50
Definition: com_data.h:111
command
Definition: version_token.cc:279