MySQL  8.0.27
Source Code Documentation
parse_tree_nodes.cc File Reference
#include "sql/parse_tree_nodes.h"
#include <algorithm>
#include <cstring>
#include <limits>
#include <utility>
#include <vector>
#include "field_types.h"
#include "m_ctype.h"
#include "m_string.h"
#include "mem_root_deque.h"
#include "my_alloc.h"
#include "my_dbug.h"
#include "mysql/mysql_lex_string.h"
#include "mysql/udf_registration_types.h"
#include "mysql_com.h"
#include "scope_guard.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/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_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/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_const.h"
#include "sql/sql_data_change.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/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 "template_utils.h"

Classes

class  PT_attribute< ATTRIBUTE, BASE >
 Generic attribute node that can be used with different base types and corrsponding parse contexts. More...
 

Namespaces

 anonymous_namespace{parse_tree_nodes.cc}
 

Typedefs

using Local_tables_iterator = IntrusiveListIterator< TABLE_LIST, &TABLE_LIST::next_local >
 
using Local_tables_list = IteratorContainer< Local_tables_iterator >
 A list interface over the TABLE_LIST::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::contextualize() on each of the nodes that are non-NULL, stopping when a call returns true. More...
 
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 TABLE_LISTmulti_delete_table_match (TABLE_LIST *tbl, TABLE_LIST *tables)
 
static bool multi_delete_link_tables (Parse_context *pc, SQL_I_List< TABLE_LIST > *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 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)
 
PT_alter_tablespace_option_basemake_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_optionmake_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_optionmake_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_basemake_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_basemake_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_optionmake_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_optionmake_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

bool pfs_processlist_enabled
 Global flag used to enable and disable SHOW PROCESSLIST in the performance schema. More...
 

Typedef Documentation

◆ Local_tables_iterator

◆ Local_tables_list

A list interface over the TABLE_LIST::next_local pointer.

Function Documentation

◆ check_unsupported_json_table_default()

static bool check_unsupported_json_table_default ( const Item item)
static

◆ init_alter_table_stmt()

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 
)
static

A common initialization part of ALTER TABLE statement variants.

Parameters
pcThe parse context.
table_nameThe name of a table to alter.
algoThe ALGORITHM clause: inplace, copy etc.
lockThe LOCK clause: none, shared, exclusive etc.
validationThe WITH or WITHOUT VALIDATION clause.
Returns
false on success, true on error.

◆ make_column_engine_attribute()

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.

Parameters
mem_rootMemory arena.
attrAttribute value from parser.
Returns
PT_create_table_option* to PT_attribute object.

◆ make_column_secondary_engine_attribute()

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.

Parameters
mem_rootMemory arena.
attrAttribute value from parser.
Returns
PT_column_attr_base* to PT_attribute object.

◆ make_index_engine_attribute()

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.

Parameters
mem_rootMemory arena.
attrAttribute value from parser.
Returns
PT_base_index_option* to PT_attribute object.

◆ make_index_secondary_engine_attribute()

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.

Parameters
mem_rootMemory arena.
attrAttribute value from parser.
Returns
PT_base_index_option* to PT_attribute object.

◆ make_table_engine_attribute()

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.

Parameters
mem_rootMemory arena.
attrAttribute value from parser.
Returns
PT_alter_tablespace_option_base* to PT_attribute object.

◆ make_table_secondary_engine_attribute()

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.

Parameters
mem_rootMemory arena.
attrAttribute value from parser.
Returns
PT_create_table_option* to PT_attribute object.

◆ make_tablespace_engine_attribute()

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.

Parameters
mem_rootMemory arena.
attrAttribute value from parser.
Returns
PT_alter_tablespace_option_base* to PT_attribute object.

◆ multi_delete_link_tables()

static bool multi_delete_link_tables ( Parse_context pc,
SQL_I_List< TABLE_LIST > *  delete_tables 
)
static

Link tables in auxiliary table list of multi-delete with corresponding elements in main table list, and set proper locks for them.

Parameters
pcParse context
delete_tablesList of tables to delete from
Returns
false if success, true if error

◆ multi_delete_table_match()

static TABLE_LIST* multi_delete_table_match ( TABLE_LIST tbl,
TABLE_LIST tables 
)
static

◆ setup_index()

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 
)
static

◆ setup_lex_show_cmd_type()

static void setup_lex_show_cmd_type ( THD thd,
Show_cmd_type  show_cmd_type 
)
static