MySQL  8.0.17
Source Code Documentation
parse_tree_nodes.h File Reference
#include <stddef.h>
#include <sys/types.h>
#include <cctype>
#include <limits>
#include "binlog_event.h"
#include "lex_string.h"
#include "m_ctype.h"
#include "my_base.h"
#include "my_bit.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_sqlcommand.h"
#include "my_sys.h"
#include "my_thread_local.h"
#include "my_time.h"
#include "mysql/mysql_lex_string.h"
#include "mysqld_error.h"
#include "sql/auth/sql_security_ctx.h"
#include "sql/enum_query_type.h"
#include "sql/handler.h"
#include "sql/item.h"
#include "sql/item_cmpfunc.h"
#include "sql/item_func.h"
#include "sql/key_spec.h"
#include "sql/mdl.h"
#include "sql/mem_root_array.h"
#include "sql/mysqld.h"
#include "sql/opt_explain.h"
#include "sql/parse_location.h"
#include "sql/parse_tree_helpers.h"
#include "sql/parse_tree_node_base.h"
#include "sql/parse_tree_partitions.h"
#include "sql/partition_info.h"
#include "sql/query_result.h"
#include "sql/resourcegroups/resource_group_basic_types.h"
#include "sql/resourcegroups/resource_group_sql_cmd.h"
#include "sql/set_var.h"
#include "sql/sp_head.h"
#include "sql/sql_admin.h"
#include "sql/sql_alter.h"
#include "sql/sql_check_constraint.h"
#include "sql/sql_class.h"
#include "sql/sql_cmd_srs.h"
#include "sql/sql_exchange.h"
#include "sql/sql_lex.h"
#include "sql/sql_list.h"
#include "sql/sql_load.h"
#include "sql/sql_parse.h"
#include "sql/sql_partition_admin.h"
#include "sql/sql_restart_server.h"
#include "sql/sql_show.h"
#include "sql/sql_tablespace.h"
#include "sql/sql_truncate.h"
#include "sql/table.h"
#include "sql/table_function.h"
#include "sql/window.h"
#include "sql/window_lex.h"
#include "sql_string.h"
#include "thr_lock.h"

Go to the source code of this file.

Classes

class  Parse_tree_root
 Base class for all top-level nodes of SQL statements. More...
 
class  PT_table_ddl_stmt_base
 
struct  Table_ddl_parse_context
 Parse context for the table DDL (ALTER TABLE and CREATE TABLE) nodes. More...
 
class  PT_order_expr
 
class  PT_order_list
 
class  PT_gorder_list
 
class  PT_common_table_expr
 Represents an element of the WITH list: WITH [...], [...] SELECT ..., ^ or ^ i.e. More...
 
class  PT_with_list
 Represents the WITH list. More...
 
class  PT_with_clause
 Represents the WITH clause: WITH [...], [...] SELECT ..., ^^^^^^^^^^^^^^^^^. More...
 
class  PT_select_item_list
 
class  PT_limit_clause
 
class  PT_table_reference
 
class  PT_table_factor_table_ident
 
class  PT_json_table_column
 
class  PT_table_factor_function
 
class  PT_table_reference_list_parens
 
class  PT_derived_table
 
class  PT_table_factor_joined_table
 
class  PT_joined_table
 
class  PT_cross_join
 
class  PT_joined_table_on
 
class  PT_joined_table_using
 
class  PT_group
 
class  PT_order
 
class  PT_locking_clause
 
class  PT_query_block_locking_clause
 
class  PT_table_locking_clause
 
class  PT_locking_clause_list
 
class  PT_query_expression_body
 
class  PT_internal_variable_name
 
class  PT_internal_variable_name_1d
 
class  PT_internal_variable_name_2d
 Parse tree node class for 2-dimentional variable names (example: @global.x) More...
 
class  PT_internal_variable_name_default
 
class  PT_option_value_following_option_type
 
class  PT_option_value_no_option_type
 
class  PT_option_value_no_option_type_internal
 
class  PT_option_value_no_option_type_user_var
 
class  PT_option_value_no_option_type_sys_var
 
class  PT_option_value_no_option_type_charset
 
class  PT_option_value_no_option_type_names
 
class  PT_set_names
 
class  PT_start_option_value_list
 
class  PT_option_value_no_option_type_password
 
class  PT_option_value_no_option_type_password_for
 
class  PT_option_value_type
 
class  PT_option_value_list_head
 
class  PT_option_value_list
 
class  PT_start_option_value_list_no_type
 
class  PT_transaction_characteristic
 
class  PT_transaction_access_mode
 
class  PT_isolation_level
 
class  PT_transaction_characteristics
 
class  PT_start_option_value_list_transaction
 
class  PT_start_option_value_list_following_option_type
 
class  PT_start_option_value_list_following_option_type_eq
 
class  PT_start_option_value_list_following_option_type_transaction
 
class  PT_start_option_value_list_type
 
class  PT_set
 
class  PT_into_destination
 
class  PT_into_destination_outfile
 
class  PT_into_destination_dumpfile
 
class  PT_select_var
 
class  PT_select_sp_var
 
class  PT_select_var_list
 
class  PT_border
 Parse tree node for a single of a window extent's borders, cf. More...
 
class  PT_borders
 Parse tree node for one or both of a window extent's borders, cf. More...
 
class  PT_exclusion
 Parse tree node for a window frame's exclusions, cf. More...
 
class  PT_frame
 Parse tree node for a window's frame, cf. More...
 
class  PT_window
 Parse tree node for a window; just a shallow wrapper for class Window, q.v. More...
 
class  PT_window_list
 Parse tree node for a list of window definitions corresponding to a <window clause> in SQL 2003. More...
 
class  PT_query_primary
 
class  PT_query_specification
 
class  PT_query_expression
 
class  PT_subquery
 
class  PT_query_expression_body_primary
 
class  PT_union
 
class  PT_nested_query_expression
 
class  PT_select_stmt
 
class  PT_delete
 Top-level node for the DELETE statement. More...
 
class  PT_update
 Top-level node for the UPDATE statement. More...
 
class  PT_insert_values_list
 
class  PT_insert
 Top-level node for the INSERT statement. More...
 
class  PT_call
 
class  PT_shutdown
 Top-level node for the SHUTDOWN statement. More...
 
class  PT_create_srs
 Top-level node for the CREATE [OR REPLACE] SPATIAL REFERENCE SYSTEM statement. More...
 
class  PT_drop_srs
 Top-level node for the DROP SPATIAL REFERENCE SYSTEM statement. More...
 
class  PT_alter_instance
 Top-level node for the ALTER INSTANCE statement. More...
 
class  PT_base_index_option
 A template-free base class for index options that we can predeclare in sql_lex.h. More...
 
class  PT_key_part_specification
 A key part specification. More...
 
class  PT_index_option< Option_type, Property >
 A template for options that set a single <alter option> value in thd->lex->key_create_info. More...
 
class  PT_traceable_index_option< Option_type, Property, Property_is_explicit >
 A template for options that set a single property in a KEY_CREATE_INFO, and also records if the option was explicitly set. More...
 
class  PT_create_index_stmt
 
class  PT_table_element
 Base class for column/constraint definitions in CREATE TABLE. More...
 
class  PT_table_constraint_def
 
class  PT_inline_index_definition
 
class  PT_foreign_key_definition
 
class  PT_ddl_table_option
 Common base class for CREATE TABLE and ALTER TABLE option nodes. More...
 
class  PT_create_table_option
 Base class for CREATE TABLE option nodes. More...
 
class  PT_traceable_create_table_option< Option_type, Property, Property_flag >
 A template for options that set a single property in HA_CREATE_INFO, and also records if the option was explicitly set. More...
 
class  PT_ternary_create_table_option< Property_flag, Default, Yes, No >
 A template for options that set HA_CREATE_INFO::table_options and also records if the option was explicitly set. More...
 
class  PT_bool_create_table_option< Property_flag, Yes, No >
 A template for options that set HA_CREATE_INFO::table_options and also records if the option was explicitly set. More...
 
class  PT_create_table_engine_option
 Node for the ENGINE [=] <identifier>|<string> table option. More...
 
class  PT_create_table_secondary_engine_option
 Node for the SECONDARY_ENGINE [=] <identifier>|<string>|NULL table option. More...
 
class  PT_create_stats_auto_recalc_option
 Node for the STATS_AUTO_RECALC [=] <0|1|DEFAULT>) table option. More...
 
class  PT_create_stats_stable_pages
 Node for the STATS_SAMPLE_PAGES [=] <integer>|DEFAULT table option. More...
 
class  PT_create_union_option
 
class  PT_create_storage_option
 
class  PT_create_table_default_charset
 
class  PT_create_table_default_collation
 
class  PT_check_constraint
 
class  PT_column_def
 
class  PT_create_table_stmt
 Top-level node for the CREATE TABLE statement. More...
 
class  PT_create_role
 
class  PT_drop_role
 
class  PT_set_role
 
struct  Privilege
 This class is used for representing both static and dynamic privileges on global as well as table and column level. More...
 
struct  Static_privilege
 
struct  Dynamic_privilege
 
class  PT_role_or_privilege
 
class  PT_role_at_host
 
class  PT_role_or_dynamic_privilege
 
class  PT_static_privilege
 
class  PT_dynamic_privilege
 
class  PT_grant_roles
 
class  PT_revoke_roles
 
class  PT_alter_user_default_role
 
class  PT_show_grants
 
class  PT_show_fields_and_keys
 Base class for Parse tree nodes of SHOW FIELDS/SHOW INDEX statements. More...
 
class  PT_show_fields
 Parse tree node for SHOW FIELDS statement. More...
 
class  PT_show_keys
 Parse tree node for SHOW INDEX statement. More...
 
class  PT_alter_table_action
 
class  PT_alter_table_add_column
 
class  PT_alter_table_add_columns
 
class  PT_alter_table_add_constraint
 
class  PT_alter_table_change_column
 
class  PT_alter_table_drop
 
class  PT_alter_table_drop_column
 
class  PT_alter_table_drop_foreign_key
 
class  PT_alter_table_drop_key
 
class  PT_alter_table_drop_check_constraint
 
class  PT_alter_table_check_constraint
 
class  PT_alter_table_enable_keys
 
class  PT_alter_table_set_default
 
class  PT_alter_table_index_visible
 
class  PT_alter_table_rename
 
class  PT_alter_table_rename_key
 
class  PT_alter_table_rename_column
 
class  PT_alter_table_convert_to_charset
 
class  PT_alter_table_force
 
class  PT_alter_table_order
 
class  PT_alter_table_partition_by
 
class  PT_alter_table_remove_partitioning
 
class  PT_alter_table_standalone_action
 
class  PT_alter_table_add_partition
 Node for the ALTER TABLE ADD PARTITION statement. More...
 
class  PT_alter_table_add_partition_def_list
 Node for the ALTER TABLE ADD PARTITION (<partition list>) statement. More...
 
class  PT_alter_table_add_partition_num
 Node for the ALTER TABLE ADD PARTITION PARTITIONS (<n>@) statement. More...
 
class  PT_alter_table_drop_partition
 
class  PT_alter_table_partition_list_or_all
 
class  PT_alter_table_rebuild_partition
 
class  PT_alter_table_optimize_partition
 
class  PT_alter_table_analyze_partition
 
class  PT_alter_table_check_partition
 
class  PT_alter_table_repair_partition
 
class  PT_alter_table_coalesce_partition
 
class  PT_alter_table_truncate_partition
 
class  PT_alter_table_reorganize_partition
 
class  PT_alter_table_reorganize_partition_into
 
class  PT_alter_table_exchange_partition
 
class  PT_alter_table_secondary_load
 
class  PT_alter_table_secondary_unload
 
class  PT_alter_table_discard_partition_tablespace
 
class  PT_alter_table_import_partition_tablespace
 
class  PT_alter_table_discard_tablespace
 
class  PT_alter_table_import_tablespace
 
class  PT_alter_table_stmt
 
class  PT_alter_table_standalone_stmt
 
class  PT_repair_table_stmt
 
class  PT_analyze_table_stmt
 
class  PT_check_table_stmt
 
class  PT_optimize_table_stmt
 
class  PT_drop_index_stmt
 
class  PT_truncate_table_stmt
 
class  PT_assign_to_keycache
 
class  PT_adm_partition
 
class  PT_cache_index_stmt
 
class  PT_cache_index_partitions_stmt
 
class  PT_preload_keys
 
class  PT_load_index_partitions_stmt
 
class  PT_load_index_stmt
 
class  PT_show_tables
 Base class for Parse tree nodes of SHOW TABLES statements. More...
 
class  PT_json_table_column_for_ordinality
 
class  PT_json_table_column_with_path
 
class  PT_json_table_column_with_nested_path
 
struct  Alter_tablespace_parse_context
 
class  PT_alter_tablespace_option< Option_type, Option >
 
class  PT_alter_tablespace_option_nodegroup
 
class  PT_alter_tablespace_option_comment
 
class  PT_alter_tablespace_option_engine
 
class  PT_alter_tablespace_option_file_block_size
 
class  PT_create_resource_group
 Parse tree node for CREATE RESOURCE GROUP statement. More...
 
class  PT_alter_resource_group
 Parse tree node for ALTER RESOURCE GROUP statement. More...
 
class  PT_drop_resource_group
 Parse tree node for DROP RESOURCE GROUP statement. More...
 
class  PT_set_resource_group
 Parse tree node for SET RESOURCE GROUP statement. More...
 
class  PT_explain_for_connection
 
class  PT_explain
 
class  PT_load_table
 
class  PT_restart_server
 Top-level node for the SHUTDOWN statement. More...
 

Macros

#define TYPE_AND_REF(x)   decltype(x), &x
 

Typedefs

typedef Parse_tree_node_tmpl< Table_ddl_parse_contextTable_ddl_node
 Base class for all table DDL (ALTER TABLE and CREATE TABLE) nodes. More...
 
typedef Mem_root_array_YY< PT_base_index_option * > Index_options
 
typedef PT_index_option< ulong, &KEY_CREATE_INFO::block_sizePT_block_size
 
typedef PT_index_option< LEX_CSTRING, &KEY_CREATE_INFO::commentPT_index_comment
 
typedef PT_index_option< LEX_CSTRING, &KEY_CREATE_INFO::parser_namePT_fulltext_index_parser_name
 
typedef PT_index_option< bool, &KEY_CREATE_INFO::is_visiblePT_index_visibility
 
typedef PT_traceable_index_option< ha_key_alg, &KEY_CREATE_INFO::algorithm, &KEY_CREATE_INFO::is_algorithm_explicitPT_index_type
 The data structure (B-tree, Hash, etc) used for an index is called 'index_type' in the manual. More...
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::max_rows), HA_CREATE_USED_MAX_ROWSPT_create_max_rows_option
 Node for the MAX_ROWS [=] <integer> table option. More...
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::min_rows), HA_CREATE_USED_MIN_ROWSPT_create_min_rows_option
 Node for the MIN_ROWS [=] <integer> table option. More...
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::avg_row_length), HA_CREATE_USED_AVG_ROW_LENGTHPT_create_avg_row_length_option
 Node for the AVG_ROW_LENGTH_ROWS [=] <integer> table option. More...
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::password), HA_CREATE_USED_PASSWORDPT_create_password_option
 Node for the PASSWORD [=] <string> table option. More...
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::comment), HA_CREATE_USED_COMMENTPT_create_commen_option
 Node for the COMMENT [=] <string> table option. More...
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::compress), HA_CREATE_USED_COMPRESSPT_create_compress_option
 Node for the COMPRESSION [=] <string> table option. More...
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::encrypt_type), HA_CREATE_USED_ENCRYPTPT_create_encryption_option
 Node for the ENGRYPTION [=] <string> table option. More...
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::auto_increment_value), HA_CREATE_USED_AUTOPT_create_auto_increment_option
 Node for the AUTO_INCREMENT [=] <integer> table option. More...
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::row_type), HA_CREATE_USED_ROW_FORMATPT_create_row_format_option
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::merge_insert_method), HA_CREATE_USED_INSERT_METHODPT_create_insert_method_option
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::data_file_name), HA_CREATE_USED_DATADIRPT_create_data_directory_option
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::index_file_name), HA_CREATE_USED_INDEXDIRPT_create_index_directory_option
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::tablespace), HA_CREATE_USED_TABLESPACEPT_create_tablespace_option
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::connect_string), HA_CREATE_USED_CONNECTIONPT_create_connection_option
 
typedef PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::key_block_size), HA_CREATE_USED_KEY_BLOCK_SIZEPT_create_key_block_size_option
 
typedef PT_ternary_create_table_option< HA_CREATE_USED_PACK_KEYS, 0, HA_OPTION_PACK_KEYS, HA_OPTION_NO_PACK_KEYSPT_create_pack_keys_option
 Node for the PACK_KEYS [=] 1|0|DEFAULT table option. More...
 
typedef PT_ternary_create_table_option< HA_CREATE_USED_STATS_PERSISTENT, 0, HA_OPTION_STATS_PERSISTENT, HA_OPTION_NO_STATS_PERSISTENTPT_create_stats_persistent_option
 Node for the STATS_PERSISTENT [=] 1|0|DEFAULT table option. More...
 
typedef PT_bool_create_table_option< HA_CREATE_USED_CHECKSUM, HA_OPTION_CHECKSUM, HA_OPTION_NO_CHECKSUMPT_create_checksum_option
 Node for the CHECKSUM|TABLE_CHECKSUM [=] 0|<not 0> table option. More...
 
typedef PT_bool_create_table_option< HA_CREATE_USED_DELAY_KEY_WRITE, HA_OPTION_DELAY_KEY_WRITE, HA_OPTION_NO_DELAY_KEY_WRITEPT_create_delay_key_write_option
 Node for the DELAY_KEY_WRITE [=] 0|<not 0> table option. More...
 
typedef Parse_tree_node_tmpl< Alter_tablespace_parse_contextPT_alter_tablespace_option_base
 
typedef PT_alter_tablespace_option< decltype(Tablespace_options::autoextend_size), &Tablespace_options::autoextend_sizePT_alter_tablespace_option_autoextend_size
 
typedef PT_alter_tablespace_option< decltype(Tablespace_options::extent_size), &Tablespace_options::extent_sizePT_alter_tablespace_option_extent_size
 
typedef PT_alter_tablespace_option< decltype(Tablespace_options::initial_size), &Tablespace_options::initial_sizePT_alter_tablespace_option_initial_size
 
typedef PT_alter_tablespace_option< decltype(Tablespace_options::max_size), &Tablespace_options::max_sizePT_alter_tablespace_option_max_size
 
typedef PT_alter_tablespace_option< decltype(Tablespace_options::redo_buffer_size), &Tablespace_options::redo_buffer_sizePT_alter_tablespace_option_redo_buffer_size
 
typedef PT_alter_tablespace_option< decltype(Tablespace_options::undo_buffer_size), &Tablespace_options::undo_buffer_sizePT_alter_tablespace_option_undo_buffer_size
 
typedef PT_alter_tablespace_option< decltype(Tablespace_options::wait_until_completed), &Tablespace_options::wait_until_completedPT_alter_tablespace_option_wait_until_completed
 
typedef PT_alter_tablespace_option< decltype(Tablespace_options::encryption), &Tablespace_options::encryptionPT_alter_tablespace_option_encryption
 

Functions

template<class Node_type , class Parse_context_type >
bool contextualize_nodes (Mem_root_array_YY< Node_type *> nodes, Parse_context_type *pc)
 Calls contextualize() on every node in the array. More...
 
template<class Context , class Node >
bool contextualize_safe (Context *pc, Node *node)
 Convenience function that calls Parse_tree_node::contextualize() on the node if it's non-NULL. More...
 
bool itemize_safe (Parse_context *pc, Item **item)
 Convenience function that calls Item::itemize() on the item if it's non-NULL. More...
 

Variables

decltype(HA_CREATE_INFO::table_options) typedef table_options_t
 

Macro Definition Documentation

◆ TYPE_AND_REF

#define TYPE_AND_REF (   x)    decltype(x), &x

Typedef Documentation

◆ Index_options

◆ PT_alter_tablespace_option_autoextend_size

◆ PT_alter_tablespace_option_base

◆ PT_alter_tablespace_option_encryption

◆ PT_alter_tablespace_option_extent_size

◆ PT_alter_tablespace_option_initial_size

◆ PT_alter_tablespace_option_max_size

◆ PT_alter_tablespace_option_redo_buffer_size

◆ PT_alter_tablespace_option_undo_buffer_size

◆ PT_alter_tablespace_option_wait_until_completed

◆ PT_block_size

◆ PT_create_connection_option

◆ PT_create_data_directory_option

◆ PT_create_index_directory_option

◆ PT_create_insert_method_option

◆ PT_create_key_block_size_option

◆ PT_create_row_format_option

◆ PT_create_tablespace_option

◆ PT_fulltext_index_parser_name

◆ PT_index_comment

◆ PT_index_type

The data structure (B-tree, Hash, etc) used for an index is called 'index_type' in the manual.

Internally, this is stored in KEY_CREATE_INFO::algorithm, while what the manual calls 'algorithm' is stored in partition_info::key_algorithm. In an <create_index_stmt> it's ignored. The terminology is somewhat confusing, but we stick to the manual in the parser.

◆ PT_index_visibility

◆ Table_ddl_node

Base class for all table DDL (ALTER TABLE and CREATE TABLE) nodes.

Function Documentation

◆ contextualize_nodes()

template<class Node_type , class Parse_context_type >
bool contextualize_nodes ( Mem_root_array_YY< Node_type *>  nodes,
Parse_context_type *  pc 
)

Calls contextualize() on every node in the array.

◆ contextualize_safe()

template<class Context , class Node >
bool contextualize_safe ( Context *  pc,
Node *  node 
)

Convenience function that calls Parse_tree_node::contextualize() on the node if it's non-NULL.

◆ itemize_safe()

bool itemize_safe ( Parse_context pc,
Item **  item 
)
inline

Convenience function that calls Item::itemize() on the item if it's non-NULL.

Variable Documentation

◆ table_options_t

decltype(HA_CREATE_INFO::table_options) typedef table_options_t