MySQL 8.4.3
Source Code Documentation
|
This class represents a query expression (one query block or several query blocks combined with UNION). More...
#include <sql_lex.h>
Public Types | |
enum | enum_clean_state { UC_DIRTY , UC_PART_CLEAN , UC_CLEAN } |
Values for Query_expression::cleaned. More... | |
Public Member Functions | |
Query_term * | query_term () const |
Getter for m_query_term, q.v. More... | |
void | set_query_term (Query_term *qt) |
Setter for m_query_term, q.v. More... | |
Query_term_set_op * | set_operation () const |
Convenience method to avoid down casting, i.e. More... | |
Query_block * | non_simple_result_query_block () const |
Return the query block iff !is_simple() holds. More... | |
bool | is_leaf_block (Query_block *qb) |
Query_term * | find_blocks_query_term (const Query_block *qb) const |
template<Visit_order order = QTC_POST_ORDER, Visit_leaves visit_leaves = VL_VISIT_LEAVES> | |
Query_terms< order, visit_leaves > | query_terms () const |
Return iterator object over query terms rooted in m_query_term, using either post order visiting (default) or pre order, optionally skipping leaf nodes (query blocks corresponding to SELECTs or table constructors). More... | |
Query_block * | last_distinct () const |
Return the Query_block of the last query term in a n-ary set operation that is the right side of the last DISTINCT set operation in that n_ary set operation: E.e. More... | |
bool | has_top_level_distinct () const |
Query_expression (enum_parsing_context parsing_context) | |
Construct and initialize Query_expression object. More... | |
bool | is_simple () const |
Query_block * | global_parameters () const |
Return the query block holding the top level ORDER BY, LIMIT and OFFSET. More... | |
bool | is_mergeable () const |
Return true if query expression can be merged into an outer query, based on technical constraints. More... | |
bool | merge_heuristic (const LEX *lex) const |
True if heuristics suggest to merge this query expression. More... | |
Query_block * | outer_query_block () const |
Query_block * | first_query_block () const |
Query_expression * | next_query_expression () const |
Query_result * | query_result () const |
RowIterator * | root_iterator () const |
unique_ptr_destroy_only< RowIterator > | release_root_iterator () |
AccessPath * | root_access_path () const |
void | change_to_access_path_without_in2exists (THD *thd) |
void | clear_root_access_path () |
bool | force_create_iterators (THD *thd) |
Ensures that there are iterators created for the access paths created by optimize(), even if it was called with create_access_paths = false. More... | |
bool | unfinished_materialization () const |
See optimize(). More... | |
Mem_root_array< MaterializePathParameters::Operand > | release_query_blocks_to_materialize () |
See optimize(). More... | |
void | set_query_result (Query_result *res) |
Set new query result object for this query expression. More... | |
bool | can_materialize_directly_into_result () const |
Whether there is a chance that optimize() is capable of materializing directly into a result table if given one. More... | |
bool | prepare (THD *thd, Query_result *result, mem_root_deque< Item * > *insert_field_list, ulonglong added_options, ulonglong removed_options) |
Prepares all query blocks of a query expression. More... | |
bool | optimize (THD *thd, TABLE *materialize_destination, bool create_iterators, bool finalize_access_paths) |
If and only if materialize_destination is non-nullptr, it means that the caller intends to materialize our result into the given table. More... | |
bool | finalize (THD *thd) |
For any non-finalized query block, finalize it so that we are allowed to create iterators. More... | |
bool | ClearForExecution () |
Do everything that would be needed before running Init() on the root iterator. More... | |
bool | ExecuteIteratorQuery (THD *thd) |
bool | execute (THD *thd) |
Execute a query expression that may be a UNION and/or have an ordered result. More... | |
bool | explain (THD *explain_thd, const THD *query_thd) |
Explain query starting from this unit. More... | |
bool | explain_query_term (THD *explain_thd, const THD *query_thd, Query_term *qt) |
void | cleanup (bool full) |
Cleanup this query expression object after preparation or one round of execution. More... | |
void | destroy () |
Destroy contained objects, in particular temporary tables which may have their own mem_roots. More... | |
void | print (const THD *thd, String *str, enum_query_type query_type) |
bool | accept (Select_lex_visitor *visitor) |
Query_block * | create_post_processing_block (Query_term_set_op *term) |
Create a block to be used for ORDERING and LIMIT/OFFSET processing of a query term, which isn't itself a query specification or table value constructor. More... | |
bool | prepare_query_term (THD *thd, Query_term *qts, Query_result *common_result, ulonglong added_options, ulonglong create_options, int level, Mem_root_array< bool > &nullable) |
Prepare the query term nodes and their associated post processing query blocks (i.e. More... | |
void | set_prepared () |
void | set_optimized () |
void | set_executed () |
void | reset_executed () |
Reset this query expression for repeated evaluation within same execution. More... | |
void | clear_execution () |
Clear execution state, needed before new execution of prepared statement. More... | |
bool | is_prepared () const |
Check state of preparation of the contained query expression. More... | |
bool | is_optimized () const |
Check state of optimization of the contained query expression. More... | |
bool | is_executed () const |
Check state of execution of the contained query expression. More... | |
bool | change_query_result (THD *thd, Query_result_interceptor *result, Query_result_interceptor *old_result) |
Change the query result object used to return the final result of the unit, replacing occurrences of old_result with new_result. More... | |
bool | set_limit (THD *thd, Query_block *provider) |
Set limit and offset for query expression object. More... | |
bool | has_any_limit () const |
Checks if this query expression has limit defined. More... | |
bool | is_union () const |
bool | is_set_operation () const |
void | include_down (LEX *lex, Query_block *outer) |
Include a query expression below a query block. More... | |
void | exclude_level () |
Exclude this unit and immediately contained query_block objects. More... | |
void | exclude_tree () |
Exclude subtree of current unit from tree of SELECTs. More... | |
void | renumber_selects (LEX *lex) |
Renumber query blocks of a query expression according to supplied LEX. More... | |
void | restore_cmd_properties () |
Loop over all query blocks and restore information needed for optimization, including binding data for all associated tables. More... | |
bool | save_cmd_properties (THD *thd) |
Save prepared statement properties for a query expression and underlying query blocks. More... | |
mem_root_deque< Item * > * | get_unit_column_types () |
Get column type information for this query expression. More... | |
mem_root_deque< Item * > * | get_field_list () |
Get field list for this query expression. More... | |
size_t | num_visible_fields () const |
enum_parsing_context | get_explain_marker (const THD *thd) const |
void | set_explain_marker (THD *thd, enum_parsing_context m) |
void | set_explain_marker_from (THD *thd, const Query_expression *u) |
void | assert_not_fully_clean () |
Asserts that none of {this unit and its children units} is fully cleaned up. More... | |
void | invalidate () |
Invalidate by nulling out pointers to other Query expressions and Query blocks. More... | |
bool | is_recursive () const |
bool | check_materialized_derived_query_blocks (THD *thd) |
Sets up query blocks belonging to the query expression of a materialized derived table. More... | |
bool | clear_correlated_query_blocks () |
Empties all correlated query blocks defined within the query expression; that is, correlated CTEs defined in the expression's WITH clause, and correlated derived tables. More... | |
void | fix_after_pullout (Query_block *parent_query_block, Query_block *removed_query_block) |
Fix used tables information for a subquery after query transformations. More... | |
void | accumulate_used_tables (table_map map) |
If unit is a subquery, which forms an object of the upper level (an Item_subselect, a derived Table_ref), adds to this object a map of tables of the upper level which the unit references. More... | |
enum_parsing_context | place () const |
If unit is a subquery, which forms an object of the upper level (an Item_subselect, a derived Table_ref), returns the place of this object in the upper level query block. More... | |
bool | walk (Item_processor processor, enum_walk walk, uchar *arg) |
bool | replace_items (Item_transformer t, uchar *arg) |
Replace all targeted items using transformer provided and info in arg. More... | |
Public Attributes | |
uint8 | uncacheable |
result of this query can't be cached, bit field, can be : UNCACHEABLE_DEPENDENT UNCACHEABLE_RAND UNCACHEABLE_SIDEEFFECT More... | |
enum_clean_state | cleaned |
cleanliness state More... | |
ha_rows | select_limit_cnt |
ha_rows | offset_limit_cnt |
Item_subselect * | item |
Points to subquery if this query expression is used in one, otherwise NULL. More... | |
PT_with_clause * | m_with_clause |
The WITH clause which is the first part of this query expression. More... | |
Table_ref * | derived_table |
If this query expression is underlying of a derived table, the derived table. More... | |
Query_block * | first_recursive |
First query block (in this UNION) which references the CTE. More... | |
table_map | m_lateral_deps |
If 'this' is body of lateral derived table: map of tables in the same FROM clause as this derived table, and to which the derived table's body makes references. More... | |
bool | m_reject_multiple_rows {false} |
This query expression represents a scalar subquery and we need a run-time check that the cardinality doesn't exceed 1. More... | |
ha_rows | send_records |
Private Member Functions | |
void | create_access_paths (THD *thd) |
Convert the executor structures to a set of access paths, storing the result in m_root_access_path. More... | |
Private Attributes | |
Query_expression * | next |
Intrusive double-linked list of all query expressions immediately contained within the same query block. More... | |
Query_expression ** | prev |
Query_block * | master |
The query block wherein this query expression is contained, NULL if the query block is the outer-most one. More... | |
Query_block * | slave |
The first query block in this query expression. More... | |
Query_term * | m_query_term {nullptr} |
enum_parsing_context | explain_marker |
Marker for subqueries in WHERE, HAVING, ORDER BY, GROUP BY and SELECT item lists. More... | |
bool | prepared |
All query blocks in query expression are prepared. More... | |
bool | optimized |
All query blocks in query expression are optimized. More... | |
bool | executed |
Query expression has been executed. More... | |
Query_result * | m_query_result |
Object to which the result for this query expression is sent. More... | |
unique_ptr_destroy_only< RowIterator > | m_root_iterator |
An iterator you can read from to get all records for this query. More... | |
AccessPath * | m_root_access_path = nullptr |
Mem_root_array< MaterializePathParameters::Operand > | m_operands |
If there is an unfinished materialization (see optimize()), contains one element for each operand (query block) in this query expression. More... | |
mem_root_deque< Item * > | types |
Friends | |
class | Query_block |
bool | parse_view_definition (THD *thd, Table_ref *view_ref) |
Parse a view definition. More... | |
This class represents a query expression (one query block or several query blocks combined with UNION).
|
explicit |
Construct and initialize Query_expression object.
bool Query_expression::accept | ( | Select_lex_visitor * | visitor | ) |
void Query_expression::accumulate_used_tables | ( | table_map | map | ) |
If unit is a subquery, which forms an object of the upper level (an Item_subselect, a derived Table_ref), adds to this object a map of tables of the upper level which the unit references.
void Query_expression::assert_not_fully_clean | ( | ) |
Asserts that none of {this unit and its children units} is fully cleaned up.
bool Query_expression::can_materialize_directly_into_result | ( | ) | const |
Whether there is a chance that optimize() is capable of materializing directly into a result table if given one.
Note that even if this function returns true, optimize() can choose later not to do so, since it depends on information (in particular, whether the query blocks can run under the iterator executor or not) that is not available before optimize time.
TODO(sgunders): Now that all query blocks can run under the iterator executor, the above may no longer be true. This needs investigation.
bool Query_expression::change_query_result | ( | THD * | thd, |
Query_result_interceptor * | new_result, | ||
Query_result_interceptor * | old_result | ||
) |
Change the query result object used to return the final result of the unit, replacing occurrences of old_result with new_result.
thd | Thread handle |
new_result | New query result object |
old_result | Old query result object |
false | Success |
true | Error |
void Query_expression::change_to_access_path_without_in2exists | ( | THD * | thd | ) |
bool Query_expression::check_materialized_derived_query_blocks | ( | THD * | thd_arg | ) |
Sets up query blocks belonging to the query expression of a materialized derived table.
thd_arg | THD pointer |
void Query_expression::cleanup | ( | bool | full | ) |
Cleanup this query expression object after preparation or one round of execution.
After the cleanup, the object can be reused for a new round of execution, but a new optimization will be needed before the execution.
bool Query_expression::clear_correlated_query_blocks | ( | ) |
Empties all correlated query blocks defined within the query expression; that is, correlated CTEs defined in the expression's WITH clause, and correlated derived tables.
|
inline |
Clear execution state, needed before new execution of prepared statement.
|
inline |
bool Query_expression::ClearForExecution | ( | ) |
Do everything that would be needed before running Init() on the root iterator.
In particular, clear out data from previous execution iterations, if needed.
|
private |
Convert the executor structures to a set of access paths, storing the result in m_root_access_path.
Query_block * Query_expression::create_post_processing_block | ( | Query_term_set_op * | term | ) |
Create a block to be used for ORDERING and LIMIT/OFFSET processing of a query term, which isn't itself a query specification or table value constructor.
Such blocks are not included in the list starting in Query_Expression::first_query_block, and Query_block::next_query_block(). They blocks are accessed via Query_term::query_block().
term | the term on behalf of which we are making a post processing block |
void Query_expression::destroy | ( | ) |
Destroy contained objects, in particular temporary tables which may have their own mem_roots.
void Query_expression::exclude_level | ( | ) |
Exclude this unit and immediately contained query_block objects.
Exclude this query expression and its immediately contained query terms and query blocks from AST.
void Query_expression::exclude_tree | ( | ) |
Exclude subtree of current unit from tree of SELECTs.
Exclude current query expression with all underlying query terms, query blocks and query expressions from AST.
bool Query_expression::execute | ( | THD * | thd | ) |
Execute a query expression that may be a UNION and/or have an ordered result.
thd | thread handle |
bool Query_expression::ExecuteIteratorQuery | ( | THD * | thd | ) |
Explain query starting from this unit.
explain_thd | thread handle for the connection doing explain |
query_thd | thread handle for the connection being explained |
bool Query_expression::explain_query_term | ( | THD * | explain_thd, |
const THD * | query_thd, | ||
Query_term * | qt | ||
) |
bool Query_expression::finalize | ( | THD * | thd | ) |
For any non-finalized query block, finalize it so that we are allowed to create iterators.
Must be called after the final access path is chosen (ie., after any calls to change_to_access_path_without_in2exists()).
|
inline |
|
inline |
bool Query_expression::force_create_iterators | ( | THD * | thd | ) |
Ensures that there are iterators created for the access paths created by optimize(), even if it was called with create_access_paths = false.
If there are already iterators, it is a no-op. optimize() must have been called earlier.
The use case for this is if we have a query block that's not top-level, but we figure out after the fact that we wanted to run it anyway. The typical case would be that we notice that the query block can return at most one row (a so-called const table), and want to run it during optimization.
enum_parsing_context Query_expression::get_explain_marker | ( | const THD * | thd | ) | const |
mem_root_deque< Item * > * Query_expression::get_field_list | ( | ) |
Get field list for this query expression.
For a UNION of query blocks, return the field list generated during prepare. For a single query block, return the field list after all possible intermediate query processing steps are done (optimization is complete).
mem_root_deque< Item * > * Query_expression::get_unit_column_types | ( | ) |
Get column type information for this query expression.
For a single query block the column types are taken from the list of selected items of this block.
For a union this function assumes that the type holders were created for unioned column types of all query blocks, by Query_expression::prepare().
|
inline |
Return the query block holding the top level ORDER BY, LIMIT and OFFSET.
If the query is not a set operation (UNION, INTERSECT or EXCEPT, and the query expression has no multi-level ORDER BY/LIMIT, this represents the single query block of the query itself, cf. documentation for class Query_term.
bool Query_expression::has_any_limit | ( | ) | const |
Checks if this query expression has limit defined.
For a query expression with set operation it checks if any of the query blocks has limit defined.
|
inline |
void Query_expression::include_down | ( | LEX * | lex, |
Query_block * | outer | ||
) |
Include a query expression below a query block.
lex | Containing LEX object |
outer | The query block that this query expression is included below. |
void Query_expression::invalidate | ( | ) |
Invalidate by nulling out pointers to other Query expressions and Query blocks.
|
inline |
Check state of execution of the contained query expression.
Should not be used to check the state of a complete statement, use LEX::is_exec_completed() instead.
bool Query_expression::is_leaf_block | ( | Query_block * | qb | ) |
bool Query_expression::is_mergeable | ( | ) | const |
Return true if query expression can be merged into an outer query, based on technical constraints.
Being mergeable also means that derived table/view is updatable.
A view/derived table is not mergeable if it is one of the following:
|
inline |
Check state of optimization of the contained query expression.
|
inline |
Check state of preparation of the contained query expression.
|
inline |
|
inline |
|
inline |
Return the Query_block of the last query term in a n-ary set operation that is the right side of the last DISTINCT set operation in that n_ary set operation: E.e.
for A UNION B UNION ALL C, B's block will be returned. If no DISTINCT is present or not a set operation, return nullptr.
bool Query_expression::merge_heuristic | ( | const LEX * | lex | ) | const |
True if heuristics suggest to merge this query expression.
A view/derived table is not suggested for merging if it contains subqueries in the SELECT list that depend on columns from itself. Merging such objects is possible, but we assume they are made derived tables because the user wants them to be materialized, for performance reasons.
One possible case is a derived table with dependent subqueries in the select list, used as the inner table of a left outer join. Such tables will always be read as many times as there are qualifying rows in the outer table, and the select list subqueries are evaluated for each row combination. The select list subqueries are evaluated the same number of times also with join buffering enabled, even though the table then only will be read once.
Another case is, a query that modifies variables: then try to preserve the original structure of the query. This is less likely to cause changes in variable assignment order.
|
inline |
|
inline |
Return the query block iff !is_simple() holds.
size_t Query_expression::num_visible_fields | ( | ) | const |
bool Query_expression::optimize | ( | THD * | thd, |
TABLE * | materialize_destination, | ||
bool | create_iterators, | ||
bool | finalize_access_paths | ||
) |
If and only if materialize_destination is non-nullptr, it means that the caller intends to materialize our result into the given table.
If it is advantageous (in particular, if this query expression is a UNION DISTINCT), optimize() will not create an iterator by itself, but rather do an unfinished materialize. This means that it will collect iterators for all the query blocks and prepare them for materializing into the given table, but not actually create a root iterator for this query expression; the caller is responsible for calling release_query_blocks_to_materialize() and creating the iterator itself.
Even if materialize_destination is non-nullptr, this function may choose to make a regular iterator. The caller is responsible for checking unfinished_materialization() if it has given a non-nullptr table.
thd | Thread handle. |
materialize_destination | What table to try to materialize into, or nullptr if the caller does not intend to materialize the result. |
create_iterators | If false, only access paths are created, not iterators. Only top level query blocks (these that we are to call exec() on) should have iterators. See also force_create_iterators(). |
finalize_access_paths | Relevant for the hypergraph optimizer only. If false, the given access paths will not be finalized, so you cannot create iterators from it before finalize() is called (see FinalizePlanForQueryBlock()), and create_iterators must also be false. This is relevant only if you are potentially optimizing multiple times (see change_to_access_path_without_in2exists()), since you are only allowed to finalize a query block once. "Fake" query blocks (see query_term.h) are always finalized. |
|
inline |
enum_parsing_context Query_expression::place | ( | ) | const |
If unit is a subquery, which forms an object of the upper level (an Item_subselect, a derived Table_ref), returns the place of this object in the upper level query block.
bool Query_expression::prepare | ( | THD * | thd, |
Query_result * | sel_result, | ||
mem_root_deque< Item * > * | insert_field_list, | ||
ulonglong | added_options, | ||
ulonglong | removed_options | ||
) |
Prepares all query blocks of a query expression.
If a recursive query expression, this also creates the materialized temporary table.
thd | Thread handler |
sel_result | Result object where the unit's output should go. |
insert_field_list | Pointer to field list if INSERT op, NULL otherwise. |
added_options | These options will be added to the query blocks. |
removed_options | Options that cannot be used for this query |
bool Query_expression::prepare_query_term | ( | THD * | thd, |
Query_term * | qt, | ||
Query_result * | common_result, | ||
ulonglong | added_options, | ||
ulonglong | create_options, | ||
int | level, | ||
Mem_root_array< bool > & | nullable | ||
) |
Prepare the query term nodes and their associated post processing query blocks (i.e.
not the ones representing the query specifications), but rather ORDER BY/LIMIT processing (old "fake" query blocks). Also create temporary tables to consolidate set operations as needed, recursively.
thd | session context | |
qt | the query term at the current level in the tree | |
common_result | For the top node, this is not used: we use query_result() instead. Otherwise, if it is empty, we create one a query result behalf of this node and its siblings. This node is then the designated owning operand, and is responsible for releasing it after execution. The siblings will see that common_result is not empty and use that. | |
added_options | options to add for the post processing query block | |
create_options | options to use for creating tmp table | |
level | the current level in the query expression's query term tree | |
[in,out] | nullable | computed nullability for the query's result set columns |
We are part of upper level set op
void Query_expression::print | ( | const THD * | thd, |
String * | str, | ||
enum_query_type | query_type | ||
) |
|
inline |
|
inline |
Getter for m_query_term, q.v.
|
inline |
Return iterator object over query terms rooted in m_query_term, using either post order visiting (default) or pre order, optionally skipping leaf nodes (query blocks corresponding to SELECTs or table constructors).
By default, we visit all nodes. Usage: for (auto qt : query_terms<..>() { ... } E.g. for (auto qt : query_terms<>()) { } Visit all nodes, post order for (auto qt : query_terms<QTC_PRE_ORDER, false>()) { } Skip leaves, pre order
order | == QTC_POST_ORDER if post order traversal is desired;default == QTC_PRE_ORDER pre-order traversal |
visit_leaves | == VL_VISIT_LEAVES: if we want the traversal to include leaf nodes i.e. the SELECTs or table constructors == VL_SKIP_LEAVES: leaves will be skipped |
|
inline |
See optimize().
|
inline |
void Query_expression::renumber_selects | ( | LEX * | lex | ) |
Renumber query blocks of a query expression according to supplied LEX.
Renumber contained query_block objects.
lex | Containing LEX object |
bool Query_expression::replace_items | ( | Item_transformer | t, |
uchar * | arg | ||
) |
Replace all targeted items using transformer provided and info in arg.
|
inline |
Reset this query expression for repeated evaluation within same execution.
void Query_expression::restore_cmd_properties | ( | ) |
Loop over all query blocks and restore information needed for optimization, including binding data for all associated tables.
|
inline |
|
inline |
bool Query_expression::save_cmd_properties | ( | THD * | thd | ) |
Save prepared statement properties for a query expression and underlying query blocks.
Required for repeated optimizations of the command.
thd | thread handler |
|
inline |
void Query_expression::set_explain_marker | ( | THD * | thd, |
enum_parsing_context | m | ||
) |
void Query_expression::set_explain_marker_from | ( | THD * | thd, |
const Query_expression * | u | ||
) |
bool Query_expression::set_limit | ( | THD * | thd, |
Query_block * | provider | ||
) |
Set limit and offset for query expression object.
thd | thread handler |
provider | Query_block to get offset and limit from. |
|
inline |
Convenience method to avoid down casting, i.e.
interpret m_query_term as a Query_term_set_op.
a | non-null node iff !is_simple |
nullptr | if is_simple() holds. |
|
inline |
|
inline |
|
inline |
Set new query result object for this query expression.
|
inline |
Setter for m_query_term, q.v.
|
inline |
See optimize().
bool Query_expression::walk | ( | Item_processor | processor, |
enum_walk | walk, | ||
uchar * | arg | ||
) |
Parse a view definition.
Among other effects, it adds underlying tables to the global list of tables, so the next iteration in open_tables() will open them.
[in] | thd | Thread handler |
[in,out] | view_ref | Table_ref structure for view reference |
|
friend |
enum_clean_state Query_expression::cleaned |
cleanliness state
Table_ref* Query_expression::derived_table |
If this query expression is underlying of a derived table, the derived table.
NULL if none.
|
private |
Query expression has been executed.
|
private |
Marker for subqueries in WHERE, HAVING, ORDER BY, GROUP BY and SELECT item lists.
Must be read/written when holding LOCK_query_plan.
See Item_subselect::explain_subquery_checker
Query_block* Query_expression::first_recursive |
First query block (in this UNION) which references the CTE.
NULL if not the query expression of a recursive CTE.
Item_subselect* Query_expression::item |
Points to subquery if this query expression is used in one, otherwise NULL.
table_map Query_expression::m_lateral_deps |
If 'this' is body of lateral derived table: map of tables in the same FROM clause as this derived table, and to which the derived table's body makes references.
In pre-resolution stages, this is OUTER_REF_TABLE_BIT, just to indicate that this has LATERAL; after resolution, which has found references in the body, this is the proper map (with no PSEUDO_TABLE_BITS anymore).
|
private |
If there is an unfinished materialization (see optimize()), contains one element for each operand (query block) in this query expression.
|
private |
Object to which the result for this query expression is sent.
Not used if we materialize directly into a parent query expression's result table (see optimize()).
|
private |
bool Query_expression::m_reject_multiple_rows {false} |
This query expression represents a scalar subquery and we need a run-time check that the cardinality doesn't exceed 1.
|
private |
|
private |
An iterator you can read from to get all records for this query.
May be nullptr even after create_access_paths(), or in the case of an unfinished materialization (see optimize()).
PT_with_clause* Query_expression::m_with_clause |
The WITH clause which is the first part of this query expression.
NULL if none.
|
private |
The query block wherein this query expression is contained, NULL if the query block is the outer-most one.
|
private |
Intrusive double-linked list of all query expressions immediately contained within the same query block.
ha_rows Query_expression::offset_limit_cnt |
|
private |
All query blocks in query expression are optimized.
|
private |
All query blocks in query expression are prepared.
|
private |
ha_rows Query_expression::select_limit_cnt |
ha_rows Query_expression::send_records |
|
private |
The first query block in this query expression.
|
private |
uint8 Query_expression::uncacheable |
result of this query can't be cached, bit field, can be : UNCACHEABLE_DEPENDENT UNCACHEABLE_RAND UNCACHEABLE_SIDEEFFECT