MySQL 8.4.3
Source Code Documentation
|
The LEX object currently serves three different purposes: More...
#include <sql_lex.h>
Public Member Functions | |
Query_block * | current_query_block () const |
void | assert_ok_set_current_query_block () |
void | set_current_query_block (Query_block *select) |
bool | is_explain () const |
bool | using_hypergraph_optimizer () const |
Whether the currently-running statement should be prepared and executed with the hypergraph optimizer. More... | |
void | set_using_hypergraph_optimizer (bool use_hypergraph) |
bool | locate_var_assignment (const Name_string &name) |
Locate an assignment to a user variable with a given name, within statement. More... | |
void | insert_values_map (Item_field *f1, Field *f2) |
void | destroy_values_map () |
void | clear_values_map () |
bool | has_values_map () const |
std::map< Item_field *, Field * >::iterator | begin_values_map () |
std::map< Item_field *, Field * >::iterator | end_values_map () |
bool | can_execute_only_in_secondary_engine () const |
void | set_execute_only_in_secondary_engine (const bool execute_only_in_secondary_engine_param, execute_only_in_secondary_reasons reason) |
execute_only_in_secondary_reasons | get_not_supported_in_primary_reason () const |
const char * | get_not_supported_in_primary_reason_str () |
bool | can_execute_only_in_hypergraph_optimizer () const |
void | set_execute_only_in_hypergraph_optimizer (bool execute_in_hypergraph_optimizer_param, execute_only_in_hypergraph_reasons reason) |
const char * | get_only_supported_in_hypergraph_reason_str () const |
execute_only_in_hypergraph_reasons | get_only_supported_in_hypergraph_reason () const |
bool | is_ignore () const |
void | set_ignore (bool ignore_param) |
void | set_has_udf () |
bool | has_udf () const |
ulonglong | statement_options () |
Gets the options that have been set for this statement. More... | |
void | add_statement_options (ulonglong options) |
Add options to values of m_statement_options. More... | |
bool | is_broken () const |
void | mark_broken (bool broken=true) |
Certain permanent transformations (like in2exists), if they fail, may leave the LEX in an inconsistent state. More... | |
bool | check_preparation_invalid (THD *thd) |
Check whether preparation state for prepared statement is invalid. More... | |
void | cleanup (bool full) |
bool | is_exec_started () const |
void | set_exec_started () |
void | reset_exec_started () |
bool | is_exec_completed () const |
Check whether the statement has been executed (regardless of completion - successful or in error). More... | |
void | set_exec_completed () |
sp_pcontext * | get_sp_current_parsing_ctx () |
void | set_sp_current_parsing_ctx (sp_pcontext *ctx) |
bool | is_metadata_used () const |
Check if the current statement uses meta-data (uses a table or a stored routine). More... | |
bool | deny_window_function (Query_block *qb) const |
We have detected the presence of an alias of a window function with a window on query block qb. More... | |
LEX () | |
virtual | ~LEX () |
void | destroy () |
Destroy contained objects, but not the LEX object itself. More... | |
void | reset () |
Reset query context to initial state. More... | |
Query_block * | new_empty_query_block () |
Create an empty query block within this LEX object. More... | |
Query_block * | new_query (Query_block *curr_query_block) |
Create query expression object that contains one query block. More... | |
Query_block * | new_set_operation_query (Query_block *curr_query_block) |
Create query block and attach it to the current query expression. More... | |
bool | new_top_level_query () |
Create top-level query expression and query block. More... | |
void | new_static_query (Query_expression *sel_query_expression, Query_block *select) |
Create query expression and query block in existing memory objects. More... | |
Query_expression * | create_query_expr_and_block (THD *thd, Query_block *current_query_block, Item *where_clause, Item *having_clause, enum_parsing_context ctx) |
Create query expression under current_query_block and a query block under the new query expression. More... | |
bool | is_ps_or_view_context_analysis () |
bool | is_view_context_analysis () |
void | clear_execution () |
Clear execution state for a statement after it has been prepared or executed, and before it is (re-)executed. More... | |
void | set_uncacheable (Query_block *curr_query_block, uint8 cause) |
Set the current query as uncacheable. More... | |
void | set_trg_event_type_for_tables () |
Set the initial purpose of this Table_ref object in the list of used tables. More... | |
Table_ref * | unlink_first_table (bool *link_to_local) |
void | link_first_table_back (Table_ref *first, bool link_to_local) |
void | first_lists_tables_same () |
void | restore_cmd_properties () |
void | restore_properties_for_insert () |
bool | save_cmd_properties (THD *thd) |
bool | can_use_merged () |
check if command can use VIEW with MERGE algorithm (for top VIEWs) More... | |
bool | can_not_use_merged () |
Check if command can't use merged views in any part of command. More... | |
bool | need_correct_ident () |
bool | which_check_option_applicable () |
void | cleanup_after_one_table_open () |
bool | push_context (Name_resolution_context *context) |
void | pop_context () |
bool | copy_db_to (char const **p_db, size_t *p_db_length) const |
This method should be called only during parsing. More... | |
bool | copy_db_to (char **p_db, size_t *p_db_length) const |
Name_resolution_context * | current_context () |
void | reset_n_backup_query_tables_list (Query_tables_list *backup) |
void | restore_backup_query_tables_list (Query_tables_list *backup) |
bool | table_or_sp_used () |
bool | is_single_level_stmt () |
check if the statement is a single-level join More... | |
void | release_plugins () |
bool | accept (Select_lex_visitor *visitor) |
bool | set_wild (LEX_STRING) |
void | clear_privileges () |
bool | make_sql_cmd (Parse_tree_root *parse_tree) |
Uses parse_tree to instantiate an Sql_cmd object and assigns it to the Lex. More... | |
Secondary_engine_execution_context * | secondary_engine_execution_context () const |
Gets the secondary engine execution context for this statement. More... | |
void | set_secondary_engine_execution_context (Secondary_engine_execution_context *context) |
Sets the secondary engine execution context for this statement. More... | |
bool | validate_use_in_old_optimizer () |
Validates if a query can run with the old optimizer. More... | |
bool | was_replication_command_executed () const |
void | set_was_replication_command_executed () |
bool | set_channel_name (LEX_CSTRING name={}) |
Set replication channel name. More... | |
void | set_rewrite_required () |
void | reset_rewrite_required () |
bool | is_rewrite_required () |
Public Member Functions inherited from Query_tables_list | |
Query_tables_list & | operator= (Query_tables_list &&)=default |
bool | is_query_tables_locked () const |
Query_tables_list ()=default | |
~Query_tables_list ()=default | |
void | reset_query_tables_list (bool init) |
void | destroy_query_tables_list () |
void | set_query_tables_list (Query_tables_list *state) |
void | add_to_query_tables (Table_ref *table) |
bool | requires_prelocking () |
void | mark_as_requiring_prelocking (Table_ref **tables_own_last) |
Table_ref * | first_not_own_table () |
void | chop_off_not_own_tables () |
bool | is_stmt_unsafe () const |
Determine if this statement is marked as unsafe. More... | |
bool | is_stmt_unsafe (enum_binlog_stmt_unsafe unsafe) |
void | set_stmt_unsafe (enum_binlog_stmt_unsafe unsafe_type) |
Flag the current (top-level) statement as unsafe. More... | |
void | set_stmt_unsafe_flags (uint32 flags) |
Set the bits of binlog_stmt_flags determining the type of unsafeness of the current statement. More... | |
uint32 | get_stmt_unsafe_flags () const |
Return a binary combination of all unsafe warnings for the statement. More... | |
bool | is_stmt_row_injection () const |
Determine if this statement is a row injection. More... | |
void | set_stmt_row_injection () |
Flag the statement as a row injection. More... | |
void | set_stmt_accessed_table (enum_stmt_accessed_table accessed_table) |
Sets the type of table that is about to be accessed while executing a statement. More... | |
bool | stmt_accessed_table (enum_stmt_accessed_table accessed_table) |
Checks if a type of table is about to be accessed while executing a statement. More... | |
bool | is_mixed_stmt_unsafe (bool in_multi_stmt_transaction_mode, bool binlog_direct, bool trx_cache_is_not_empty, uint tx_isolation) |
bool | uses_stored_routines () const |
true if the parsed tree contains references to stored procedures or functions, false otherwise More... | |
void | set_using_match () |
bool | get_using_match () |
void | set_stmt_unsafe_with_mixed_mode () |
bool | is_stmt_unsafe_with_mixed_mode () const |
Private Attributes | |
Query_block * | m_current_query_block |
bool | m_can_execute_only_in_secondary_engine = false |
execute_only_in_secondary_reasons | m_execute_only_in_secondary_engine_reason |
bool | m_can_execute_only_in_hypergraph_optimizer = false |
execute_only_in_hypergraph_reasons | m_execute_only_in_hypergraph_reason |
bool | m_using_hypergraph_optimizer {false} |
std::map< Item_field *, Field * > * | insert_update_values_map |
bool | m_has_udf {false} |
True if statement references UDF functions. More... | |
bool | ignore |
bool | m_broken |
see mark_broken() More... | |
bool | m_exec_started |
Set to true when execution has started (after parsing, tables opened and query preparation is complete. More... | |
bool | m_exec_completed |
Set to true when execution is completed, ie optimization has been done and execution is successful or ended in error. More... | |
sp_pcontext * | sp_current_parsing_ctx |
Current SP parsing context. More... | |
ulonglong | m_statement_options {0} |
Statement context for Query_block::make_active_options. More... | |
Secondary_engine_execution_context * | m_secondary_engine_context {nullptr} |
Context object used by secondary storage engines to store query state during optimization and execution. More... | |
bool | m_was_replication_command_executed {false} |
bool | rewrite_required {false} |
Friends | |
bool | lex_start (THD *thd) |
Call lex_start() before every query that is to be prepared and executed. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Query_tables_list | |
static const char * | stmt_accessed_table_string (enum_stmt_accessed_table accessed_table) |
Static Public Attributes inherited from Query_tables_list | |
static const int | BINLOG_STMT_UNSAFE_ALL_FLAGS |
This has all flags from 0 (inclusive) to BINLOG_STMT_FLAG_COUNT (exclusive) set. More... | |
static const int | binlog_stmt_unsafe_errcode [BINLOG_STMT_UNSAFE_COUNT] |
Maps elements of enum_binlog_stmt_unsafe to error codes. More... | |
The LEX object currently serves three different purposes:
The LEX object is strictly a part of class Sql_cmd, for those SQL commands that are represented by an Sql_cmd class. For the remaining SQL commands, it is a standalone object linked to the current THD.
The lifecycle of a LEX object is as follows:
LEX::LEX | ( | ) |
|
virtual |
bool LEX::accept | ( | Select_lex_visitor * | visitor | ) |
|
inline |
Add options to values of m_statement_options.
options is an ORed bit set of options defined in query_options.h
options | Add this set of options to the set already in m_statement_options |
void LEX::assert_ok_set_current_query_block | ( | ) |
|
inline |
|
inline |
|
inline |
bool LEX::can_not_use_merged | ( | ) |
Check if command can't use merged views in any part of command.
Temporary table algorithm will be used on all SELECT levels for queries listed here (see also LEX::can_use_merged()).
bool LEX::can_use_merged | ( | ) |
check if command can use VIEW with MERGE algorithm (for top VIEWs)
Only listed here commands can use merge algorithm in top level Query_block (for subqueries will be used merge algorithm if LEX::can_not_use_merged() is not true).
bool LEX::check_preparation_invalid | ( | THD * | thd_arg | ) |
Check whether preparation state for prepared statement is invalid.
Preparation state amy become invalid if a repreparation is forced, e.g because of invalid metadata, and that repreparation fails.
|
inline |
void LEX::cleanup_after_one_table_open | ( | ) |
void LEX::clear_execution | ( | ) |
Clear execution state for a statement after it has been prepared or executed, and before it is (re-)executed.
void LEX::clear_privileges | ( | ) |
|
inline |
|
inline |
bool LEX::copy_db_to | ( | char const ** | p_db, |
size_t * | p_db_length | ||
) | const |
This method should be called only during parsing.
It is aware of compound statements (stored routine bodies) and will initialize the destination with the default database of the stored routine, rather than the default database of the connection it is parsed in. E.g. if one has no current database selected, or current database set to 'bar' and then issues:
CREATE PROCEDURE foo.p1() BEGIN SELECT * FROM t1 END//
t1 is meant to refer to foo.t1, not to bar.t1.
This method is needed to support this rule.
Query_expression * LEX::create_query_expr_and_block | ( | THD * | thd, |
Query_block * | current_query_block, | ||
Item * | where_clause, | ||
Item * | having_clause, | ||
enum_parsing_context | ctx | ||
) |
Create query expression under current_query_block and a query block under the new query expression.
The new query expression is linked in under current_query_block. The new query block is linked in under the new query expression.
thd | current session context |
current_query_block | the root under which we create the new expression and block |
where_clause | any where clause for the block |
having_clause | any having clause for the block |
ctx | the parsing context |
|
inline |
|
inline |
|
inline |
We have detected the presence of an alias of a window function with a window on query block qb.
Check if the reference is illegal at this point during resolution.
qb | The query block of the window function |
m_deny_window_func
.
|
inline |
Destroy contained objects, but not the LEX object itself.
|
inline |
|
inline |
void LEX::first_lists_tables_same | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Check whether the statement has been executed (regardless of completion - successful or in error).
Check this instead of Query_expression::is_executed() to determine the state of a complete statement.
|
inline |
|
inline |
|
inline |
|
inline |
Check if the current statement uses meta-data (uses a table or a stored routine).
|
inline |
|
inline |
|
inline |
check if the statement is a single-level join
true | The statement doesn't contain subqueries, unions and stored procedure calls. |
false | There are subqueries, UNIONs or stored procedure calls. |
|
inline |
void LEX::link_first_table_back | ( | Table_ref * | first, |
bool | link_to_local | ||
) |
bool LEX::locate_var_assignment | ( | const Name_string & | name | ) |
Locate an assignment to a user variable with a given name, within statement.
name | Name of variable to search for |
bool LEX::make_sql_cmd | ( | Parse_tree_root * | parse_tree | ) |
Uses parse_tree to instantiate an Sql_cmd object and assigns it to the Lex.
parse_tree | The parse tree. |
|
inline |
Certain permanent transformations (like in2exists), if they fail, may leave the LEX in an inconsistent state.
They should call the following function, so that this LEX is not reused by another execution.
bool LEX::need_correct_ident | ( | ) |
Query_block * LEX::new_empty_query_block | ( | ) |
Create an empty query block within this LEX object.
Query_block * LEX::new_query | ( | Query_block * | curr_query_block | ) |
Create query expression object that contains one query block.
Create new query_block_query_expression and query_block objects for a query block, which can be either a top-level query or a subquery.
For the second and subsequent query block of a UNION query, use LEX::new_set_operation_query() instead. Set the new query_block as the current query_block of the LEX object.
curr_query_block | current query block, NULL if an outer-most query block should be created. |
Query_block * LEX::new_set_operation_query | ( | Query_block * | curr_query_block | ) |
Create query block and attach it to the current query expression.
Create new query_block object for all branches of a UNION, EXCEPT or INTERSECT except the left-most one.
Set the new query_block as the current query_block of the LEX object.
curr_query_block | current query specification |
void LEX::new_static_query | ( | Query_expression * | sel_query_expression, |
Query_block * | select | ||
) |
Create query expression and query block in existing memory objects.
Initialize a LEX object, a query expression object (query_block_query_expression) and a query block object (query_block).
All objects are passed as pointers so they can be stack-allocated. The purpose of this structure is for short-lived procedures that need a LEX and a query block object.
Do not extend the struct with more query objects after creation.
The struct can be abandoned after use, no cleanup is needed.
sel_query_expression | Pointer to the query expression object |
select | Pointer to the query block object |
bool LEX::new_top_level_query | ( | ) |
Create top-level query expression and query block.
Given a LEX object, create a query expression object (query_block_query_expression) and a query block object (query_block).
|
inline |
|
inline |
void LEX::release_plugins | ( | ) |
void LEX::reset | ( | void | ) |
Reset query context to initial state.
Reset a LEX object so that it is ready for a new query preparation and execution.
Pointers to query expression and query block objects are set to NULL. This is correct, as they point into a mem_root that has been recycled.
|
inline |
void LEX::reset_n_backup_query_tables_list | ( | Query_tables_list * | backup | ) |
|
inline |
void LEX::restore_backup_query_tables_list | ( | Query_tables_list * | backup | ) |
|
inline |
|
inline |
|
inline |
|
inline |
Gets the secondary engine execution context for this statement.
bool LEX::set_channel_name | ( | LEX_CSTRING | name = {} | ) |
Set replication channel name.
name | If name is null string then reset channel name to default. Otherwise set it to name . |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void LEX::set_secondary_engine_execution_context | ( | Secondary_engine_execution_context * | context | ) |
Sets the secondary engine execution context for this statement.
The old context object is destroyed, if there is one. Can be set to nullptr to destroy the old context object and clear the pointer.
The supplied context object should be allocated on the execution MEM_ROOT, so that its memory doesn't have to be manually freed after query execution.
|
inline |
void LEX::set_trg_event_type_for_tables | ( | ) |
Set the initial purpose of this Table_ref object in the list of used tables.
We need to track this information on table-by-table basis, since when this table becomes an element of the pre-locked list, it's impossible to identify which SQL sub-statement it has been originally used in.
E.g.:
User request: SELECT * FROM t1 WHERE f1(); FUNCTION f1(): DELETE FROM t2; RETURN 1; BEFORE DELETE trigger on t2: INSERT INTO t3 VALUES (old.a);
For this user request, the pre-locked list will contain t1, t2, t3 table elements, each needed for different DML.
The trigger event map is updated to reflect INSERT, UPDATE, DELETE, REPLACE, LOAD DATA, CREATE TABLE .. SELECT, CREATE TABLE .. REPLACE SELECT statements, and additionally ON DUPLICATE KEY UPDATE clause.
|
inline |
Set the current query as uncacheable.
curr_query_block | Current select query block |
cause | Why this query is uncacheable. |
All query blocks representing subqueries, from the current one up to the outer-most one, but excluding the main query block, are also set as uncacheable.
|
inline |
|
inline |
bool LEX::set_wild | ( | LEX_STRING | w | ) |
|
inline |
Gets the options that have been set for this statement.
The options are propagated to the Query_block objects and should usually be read with Query_block::active_options().
bool LEX::table_or_sp_used | ( | ) |
Table_ref * LEX::unlink_first_table | ( | bool * | link_to_local | ) |
|
inline |
Whether the currently-running statement should be prepared and executed with the hypergraph optimizer.
This will not change after the statement is prepared, so you can use it in any optimization phase to e.g. figure out whether to inhibit some transformation that the hypergraph optimizer does not properly understand yet. If a different optimizer is requested, the statement must be re-prepared with the proper optimizer settings.
bool LEX::validate_use_in_old_optimizer | ( | ) |
Validates if a query can run with the old optimizer.
|
inline |
|
inline |
|
friend |
Call lex_start() before every query that is to be prepared and executed.
Because of this, it's critical not to do too many things here. (We already do too much)
The function creates a query_block and a query_block_query_expression object. These objects should rather be created by the parser bottom-up.
bool LEX::all_privileges |
Query_block* LEX::all_query_blocks_list |
List of all query blocks.
nesting_map LEX::allow_sum_func |
This field is used as a work field during resolving to validate the use of aggregate functions.
For example in a query SELECT ... FROM ...WHERE MIN(i) == 1 GROUP BY ... HAVING MIN(i) > 2 MIN(i) in the WHERE clause is not allowed since only non-aggregated data is present, whereas MIN(i) in the HAVING clause is allowed because HAVING operates on the output of a grouping operation. Each query block is assigned a nesting level. This field is a bit field that contains the value one in the position of that nesting level if aggregate functions are allowed for that query block.
Alter_info* LEX::alter_info |
LEX_ALTER LEX::alter_password |
enum_alter_user_attribute LEX::alter_user_attribute |
LEX_STRING LEX::alter_user_comment_text |
bool LEX::autocommit |
bool LEX::binlog_need_explicit_defaults_ts |
LEX_STRING LEX::binlog_stmt_arg |
Argument of the BINLOG event statement.
ulonglong LEX::bulk_insert_row_cnt |
HA_CHECK_OPT LEX::check_opt |
List<LEX_COLUMN> LEX::columns |
bool LEX::contains_plaintext_password |
uint8 LEX::context_analysis_only |
List<Name_resolution_context> LEX::context_stack |
HA_CREATE_INFO* LEX::create_info |
uint8 LEX::create_view_algorithm |
uint8 LEX::create_view_check |
enum_view_create_mode LEX::create_view_mode |
LEX_STRING LEX::create_view_query_block |
SELECT of CREATE VIEW statement.
uint8 LEX::create_view_suid |
LEX_USER* LEX::definer |
bool LEX::drop_if_exists |
bool LEX::drop_temporary |
enum enum_duplicates LEX::duplicates |
List<LEX_CSTRING> LEX::dynamic_privileges |
Event_parse_data* LEX::event_parse_data |
class Explain_format* LEX::explain_format {nullptr} |
bool LEX::expr_allows_subquery {true} |
uint LEX::grant |
LEX_GRANT_AS LEX::grant_as |
bool LEX::grant_if_exists |
refers to optional IF EXISTS clause in REVOKE sql.
This flag when set to true will report warnings in case privilege being granted is not granted to given user/role. When set to false error is reported.
bool LEX::grant_privilege |
Set to true when GRANT ... GRANT OPTION ... TO ... is used (vs.
GRANT ... WITH GRANT OPTION). The flag is used by mysql_grant to grant GRANT OPTION (GRANT_ACL) to all dynamic privileges.
uint LEX::grant_tot_col |
LEX_USER* LEX::grant_user |
char* LEX::help_arg |
LEX_STRING LEX::ident |
|
private |
bool LEX::ignore_unknown_user |
refers to optional IGNORE UNKNOWN USER clause in REVOKE sql.
This flag when set to true will report warnings in case target user/role for which privilege being granted does not exists. When set to false error is reported.
Item_sum* LEX::in_sum_func |
bool LEX::in_update_value_clause |
Set to true while resolving values in ON DUPLICATE KEY UPDATE clause.
Table_ref* LEX::insert_table |
Table being inserted into (may be a view)
Table_ref* LEX::insert_table_leaf |
Leaf table being inserted into (always a base table)
|
private |
bool LEX::is_explain_analyze = false |
bool LEX::is_lex_started |
enum_keep_diagnostics LEX::keep_diagnostics |
KEY_CREATE_INFO LEX::key_create_info |
|
private |
see mark_broken()
|
private |
|
private |
|
private |
nesting_map LEX::m_deny_window_func |
Windowing functions are not allowed in HAVING - in contrast to grouped aggregate functions, since windowing in SQL logically follows after all grouping operations.
Nor are they allowed inside grouped aggregate function arguments. One bit per query block, as also allow_sum_func
. For ORDER BY and QUALIFY predicates, window functions are allowed unless they are contained in arguments of a grouped aggregate function. Nor are references to outer window functions (via alias) allowed in subqueries, but that is checked separately.
|
private |
Set to true when execution is completed, ie optimization has been done and execution is successful or ended in error.
|
private |
Set to true when execution has started (after parsing, tables opened and query preparation is complete.
Used to track arena state for SPs).
|
private |
|
private |
bool LEX::m_extended_show |
|
private |
True if statement references UDF functions.
dd::info_schema::Table_statistics LEX::m_IS_table_stats |
IS schema queries read some dynamic table statistics from SE.
These statistics are cached, to avoid opening of table more than once while preparing a single output record buffer.
dd::info_schema::Tablespace_statistics LEX::m_IS_tablespace_stats |
|
private |
Context object used by secondary storage engines to store query state during optimization and execution.
Sql_cmd* LEX::m_sql_cmd |
|
private |
Statement context for Query_block::make_active_options.
bool LEX::m_subquery_to_derived_is_impossible |
If true: during prepare, we did a subquery transformation (IN-to-EXISTS, SOME/ANY) that doesn't currently work for subquery to a derived table transformation.
|
private |
|
private |
ulong LEX::max_execution_time |
LEX_SOURCE_INFO LEX::mi |
USER_RESOURCES LEX::mqh |
LEX_STRING LEX::name |
uint32 LEX::next_binlog_file_nr |
bool LEX::no_write_to_binlog |
bool LEX::only_view |
Opt_hints_global* LEX::opt_hints_global |
enum enum_var_type LEX::option_type |
List<Item_param> LEX::param_list |
List of placeholders ('?') for parameters of a prepared statement.
Because we append to this list during parsing, it is naturally sorted by position of the '?' in the query string. The code which fills placeholders with user-supplied values, and the code which writes a query for statement-based logging, rely on this order. This list contains only real placeholders, not the clones which originate in a re-parsed CTE definition.
st_parsing_options LEX::parsing_options |
partition_info* LEX::part_info |
Plugins_array LEX::plugins |
LEX_STRING LEX::prepared_stmt_code |
bool LEX::prepared_stmt_code_is_varref |
LEX_CSTRING LEX::prepared_stmt_name |
List<LEX_STRING> LEX::prepared_stmt_params |
uint LEX::profile_options |
Query_block* LEX::query_block |
First query block.
uint LEX::reparse_common_table_expr_at |
If currently re-parsing a CTE's definition, this is the offset in bytes of that definition in the original statement which had the WITH clause.
Otherwise this is 0.
bool LEX::reparse_derived_table_condition {false} |
If currently re-parsing a condition which is pushed down to a derived table, this will be set to true.
std::vector<uint> LEX::reparse_derived_table_params_at |
If currently re-parsing a condition that is being pushed down to a derived table, this has the positions of all the parameters that are part of that condition in the original statement.
Otherwise it is empty.
LEX_REPLICA_CONNECTION LEX::replica_connection |
uint LEX::replica_thd_opt |
LEX_RESET_REPLICA LEX::reset_replica_info |
Query_result* LEX::result |
|
private |
bool LEX::safe_to_cache_query |
Whether this query will return the same answer every time, given unchanged data.
Used to be for the query cache, but is now used to find out if an expression is usable for partitioning.
int LEX::select_number |
Number of query block (by EXPLAIN)
Server_options LEX::server_options |
List<Item_func_set_user_var> LEX::set_var_list |
my_thread_id LEX::show_profile_query_id |
QUERY ID for SHOW PROFILE.
st_sp_chistics LEX::sp_chistics |
|
private |
Current SP parsing context.
bool LEX::sp_lex_in_use |
sp_head* LEX::sphead |
sp_name* LEX::spname |
const char * LEX::ssl_cipher |
enum SSL_type LEX::ssl_type |
uint LEX::start_transaction_opt |
const char* LEX::stmt_definition_begin |
Intended to point to the next word after DEFINER-clause in the following statements:
This pointer is required to add possibly omitted DEFINER-clause to the DDL-statement before dumping it to the binlog.
const char* LEX::stmt_definition_end |
THD* LEX::thd |
char* LEX::to_log |
enum enum_tx_isolation LEX::tx_isolation |
enum enum_yes_no_unknown tx_chain LEX::tx_release |
ulong LEX::type |
udf_func LEX::udf |
Query_expression* LEX::unit |
Outer-most query expression.
bool LEX::use_only_table_context |
During name resolution search only in the table list given by Name_resolution_context::first_name_resolution_table and Name_resolution_context::last_name_resolution_table (see Item_field::fix_fields()).
List<set_var_base> LEX::var_list |
bool LEX::verbose |
String* LEX::wild |
bool LEX::will_contextualize |
Used to inform the parser whether it should contextualize the parse tree.
When we get a pure parser this will not be needed.
const char * LEX::x509_issuer |
const char* LEX::x509_subject |