MySQL 8.4.3
Source Code Documentation
|
#include "sql/parse_tree_nodes.h"
#include <algorithm>
#include <cstring>
#include <limits>
#include <utility>
#include <vector>
#include "field_types.h"
#include "mem_root_deque.h"
#include "my_alloc.h"
#include "my_dbug.h"
#include "mysql/mysql_lex_string.h"
#include "mysql/strings/m_ctype.h"
#include "mysql/udf_registration_types.h"
#include "mysql_com.h"
#include "scope_guard.h"
#include "sql/auth/auth_acls.h"
#include "sql/auth/sql_security_ctx.h"
#include "sql/create_field.h"
#include "sql/dd/info_schema/show.h"
#include "sql/dd/types/abstract_table.h"
#include "sql/dd/types/column.h"
#include "sql/derror.h"
#include "sql/field.h"
#include "sql/gis/srid.h"
#include "sql/intrusive_list_iterator.h"
#include "sql/item.h"
#include "sql/item_cmpfunc.h"
#include "sql/item_func.h"
#include "sql/item_timefunc.h"
#include "sql/key_spec.h"
#include "sql/lex.h"
#include "sql/mdl.h"
#include "sql/mysqld.h"
#include "sql/opt_explain_json.h"
#include "sql/opt_explain_traditional.h"
#include "sql/parse_location.h"
#include "sql/parse_tree_column_attrs.h"
#include "sql/parse_tree_hints.h"
#include "sql/parse_tree_items.h"
#include "sql/parse_tree_partitions.h"
#include "sql/parse_tree_window.h"
#include "sql/parser_yystype.h"
#include "sql/query_options.h"
#include "sql/query_result.h"
#include "sql/query_term.h"
#include "sql/sp.h"
#include "sql/sp_head.h"
#include "sql/sp_instr.h"
#include "sql/sp_pcontext.h"
#include "sql/sql_base.h"
#include "sql/sql_call.h"
#include "sql/sql_class.h"
#include "sql/sql_cmd.h"
#include "sql/sql_cmd_ddl_table.h"
#include "sql/sql_component.h"
#include "sql/sql_const.h"
#include "sql/sql_data_change.h"
#include "sql/sql_db.h"
#include "sql/sql_delete.h"
#include "sql/sql_do.h"
#include "sql/sql_error.h"
#include "sql/sql_insert.h"
#include "sql/sql_parse.h"
#include "sql/sql_select.h"
#include "sql/sql_show.h"
#include "sql/sql_show_processlist.h"
#include "sql/sql_show_status.h"
#include "sql/sql_update.h"
#include "sql/strfunc.h"
#include "sql/system_variables.h"
#include "sql/table_function.h"
#include "sql/thr_malloc.h"
#include "sql/trigger_def.h"
#include "sql/window.h"
#include "sql_string.h"
#include "string_with_len.h"
#include "strxmov.h"
#include "template_utils.h"
Classes | |
class | PT_attribute< ATTRIBUTE, BASE > |
Generic attribute node that can be used with different base types and corresponding parse contexts. More... | |
Namespaces | |
namespace | anonymous_namespace{parse_tree_nodes.cc} |
Typedefs | |
using | Local_tables_iterator = IntrusiveListIterator< Table_ref, &Table_ref::next_local > |
using | Local_tables_list = IteratorContainer< Local_tables_iterator > |
A list interface over the Table_ref::next_local pointer. More... | |
Functions | |
template<typename Context , typename Node > | |
bool | anonymous_namespace{parse_tree_nodes.cc}::contextualize_safe (Context *pc, Node node) |
template<typename Context > | |
bool | anonymous_namespace{parse_tree_nodes.cc}::contextualize_safe (Context *pc, mem_root_deque< Item * > *list) |
template<typename Context , typename Node , typename... Nodes> | |
bool | anonymous_namespace{parse_tree_nodes.cc}::contextualize_safe (Context *pc, Node node, Nodes... nodes) |
Convenience function that calls Parse_tree_node::do_contextualize() on each of the nodes that are non-NULL, stopping when a call returns true. More... | |
static void | anonymous_namespace{parse_tree_nodes.cc}::print_table_ident (const THD *thd, const Table_ident *ident, String *s) |
bool | anonymous_namespace{parse_tree_nodes.cc}::itemize_safe (Parse_context *pc, Item **item) |
Convenience function that calls Item::itemize() on the item if it's non-NULL. More... | |
static bool | is_transition_variable_prefix (const Parse_context &pc, const LEX_CSTRING &opt_prefix, const char *prefix) |
Recognize the transition variable syntax: { OLD | NEW } "." ... More... | |
static bool | is_old_transition_variable_prefix (const Parse_context &pc, const LEX_CSTRING &opt_prefix) |
static bool | is_new_transition_variable_prefix (const Parse_context &pc, const LEX_CSTRING &opt_prefix) |
static bool | is_any_transition_variable_prefix (const Parse_context &pc, const LEX_CSTRING &opt_prefix) |
Recognize any of transition variable syntax: { NEW | OLD } "." ... More... | |
static sp_variable * | find_sp_variable (const Parse_context &pc, const LEX_CSTRING &name) |
Try to resolve a name as SP formal parameter or local variable. More... | |
static bool | set_trigger_new_row (Parse_context *pc, LEX_CSTRING trigger_field_name, Item *expr_item, const POS &expr_pos) |
Helper action for a SET statement. More... | |
static bool | add_system_variable_assignment (THD *thd, LEX_CSTRING prefix, LEX_CSTRING suffix, enum enum_var_type var_type, Item *val) |
Helper action for a SET statement. More... | |
static Table_ref * | multi_delete_table_match (Table_ref *tbl, Table_ref *tables) |
static bool | multi_delete_link_tables (Parse_context *pc, SQL_I_List< Table_ref > *delete_tables) |
Link tables in auxiliary table list of multi-delete with corresponding elements in main table list, and set proper locks for them. More... | |
static Surrounding_context | qt2sc (Query_term_type qtt) |
static bool | setup_index (keytype key_type, const LEX_STRING name, PT_base_index_option *type, List< PT_key_part_specification > *columns, Index_options options, Table_ddl_parse_context *pc) |
bool | set_default_charset (HA_CREATE_INFO *create_info, const CHARSET_INFO *value) |
bool | set_default_collation (HA_CREATE_INFO *create_info, const CHARSET_INFO *collation) |
static void | setup_lex_show_cmd_type (THD *thd, Show_cmd_type show_cmd_type) |
static bool | init_alter_table_stmt (Table_ddl_parse_context *pc, Table_ident *table_name, Alter_info::enum_alter_table_algorithm algo, Alter_info::enum_alter_table_lock lock, Alter_info::enum_with_validation validation) |
A common initialization part of ALTER TABLE statement variants. More... | |
static bool | check_unsupported_json_table_default (const Item *item) |
static Query_block * | build_query_for_show_parse (const POS &pos, THD *thd, const std::string_view &json_tree) |
Build a parsed tree for : SELECT '...json tree string...' as show_parse_tree. More... | |
PT_alter_tablespace_option_base * | make_tablespace_engine_attribute (MEM_ROOT *mem_root, LEX_CSTRING attr) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer. More... | |
PT_create_table_option * | make_table_engine_attribute (MEM_ROOT *mem_root, LEX_CSTRING attr) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer. More... | |
PT_create_table_option * | make_table_secondary_engine_attribute (MEM_ROOT *mem_root, LEX_CSTRING attr) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer. More... | |
PT_column_attr_base * | make_column_engine_attribute (MEM_ROOT *mem_root, LEX_CSTRING attr) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer. More... | |
PT_column_attr_base * | make_column_secondary_engine_attribute (MEM_ROOT *mem_root, LEX_CSTRING attr) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer. More... | |
PT_base_index_option * | make_index_engine_attribute (MEM_ROOT *mem_root, LEX_CSTRING attr) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer. More... | |
PT_base_index_option * | make_index_secondary_engine_attribute (MEM_ROOT *mem_root, LEX_CSTRING attr) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer. More... | |
Variables | |
static constexpr const size_t | MAX_SYS_VAR_LENGTH {32} |
A list interface over the Table_ref::next_local pointer.
|
static |
Helper action for a SET statement.
Used to push a system variable into the assignment list. In stored routines detects "SET AUTOCOMMIT" and reject "SET GTID..." stuff.
thd | the current thread |
prefix | left hand side of a qualified name (if any) or nullptr string |
suffix | the right hand side of a qualified name (if any) or a whole unqualified name |
var_type | the scope of the variable |
val | the value being assigned to the variable |
|
static |
Build a parsed tree for : SELECT '...json tree string...' as show_parse_tree.
Essentially the SHOW PARSE_TREE statement is converted into the above SQL and passed to the executor.
|
static |
|
static |
Try to resolve a name as SP formal parameter or local variable.
pc | Parse context |
name | Name of probable SP variable |
|
static |
A common initialization part of ALTER TABLE statement variants.
pc | The parse context. |
table_name | The name of a table to alter. |
algo | The ALGORITHM clause: inplace, copy etc. |
lock | The LOCK clause: none, shared, exclusive etc. |
validation | The WITH or WITHOUT VALIDATION clause. |
|
static |
Recognize any of transition variable syntax: { NEW | OLD } "." ...
pc | Parse context |
opt_prefix | Optional prefix or empty LEX_CSTRING |
|
static |
|
static |
|
static |
Recognize the transition variable syntax: { OLD | NEW } "." ...
pc | Parse context |
opt_prefix | Optional prefix to examine or empty LEX_CSTRING |
prefix | "OLD" or "NEW" to compare with |
PT_column_attr_base * make_column_engine_attribute | ( | MEM_ROOT * | mem_root, |
LEX_CSTRING | attr | ||
) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer.
mem_root | Memory arena. |
attr | Attribute value from parser. |
PT_column_attr_base * make_column_secondary_engine_attribute | ( | MEM_ROOT * | mem_root, |
LEX_CSTRING | attr | ||
) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer.
mem_root | Memory arena. |
attr | Attribute value from parser. |
PT_base_index_option * make_index_engine_attribute | ( | MEM_ROOT * | mem_root, |
LEX_CSTRING | attr | ||
) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer.
mem_root | Memory arena. |
attr | Attribute value from parser. |
PT_base_index_option * make_index_secondary_engine_attribute | ( | MEM_ROOT * | mem_root, |
LEX_CSTRING | attr | ||
) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer.
mem_root | Memory arena. |
attr | Attribute value from parser. |
PT_create_table_option * make_table_engine_attribute | ( | MEM_ROOT * | mem_root, |
LEX_CSTRING | attr | ||
) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer.
mem_root | Memory arena. |
attr | Attribute value from parser. |
PT_create_table_option * make_table_secondary_engine_attribute | ( | MEM_ROOT * | mem_root, |
LEX_CSTRING | attr | ||
) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer.
mem_root | Memory arena. |
attr | Attribute value from parser. |
PT_alter_tablespace_option_base * make_tablespace_engine_attribute | ( | MEM_ROOT * | mem_root, |
LEX_CSTRING | attr | ||
) |
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided mem_root, and returns the appropriate base pointer.
mem_root | Memory arena. |
attr | Attribute value from parser. |
|
static |
Link tables in auxiliary table list of multi-delete with corresponding elements in main table list, and set proper locks for them.
pc | Parse context |
delete_tables | List of tables to delete from |
|
static |
|
static |
Helper action for a SET statement.
Used to SET a field of NEW row.
pc | the parse context |
trigger_field_name | the NEW-row field name |
expr_item | the value expression to be assigned |
expr_pos | the value expression query |
|
static |
|
static |
|
staticconstexpr |