MySQL 8.4.3
Source Code Documentation
|
Implements the subselect Item, used when there is a subselect in a SELECT list, WHERE, etc. More...
#include "sql/item_subselect.h"
#include <climits>
#include <cstdio>
#include <cstring>
#include <initializer_list>
#include <memory>
#include <string>
#include <utility>
#include "decimal.h"
#include "lex_string.h"
#include "my_alloc.h"
#include "my_base.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_pointer_arithmetic.h"
#include "my_sys.h"
#include "mysql/strings/m_ctype.h"
#include "mysql_com.h"
#include "mysqld_error.h"
#include "scope_guard.h"
#include "sql-common/my_decimal.h"
#include "sql/check_stack.h"
#include "sql/current_thd.h"
#include "sql/debug_sync.h"
#include "sql/derror.h"
#include "sql/field.h"
#include "sql/handler.h"
#include "sql/item_cmpfunc.h"
#include "sql/item_func.h"
#include "sql/item_sum.h"
#include "sql/iterators/basic_row_iterators.h"
#include "sql/iterators/composite_iterators.h"
#include "sql/iterators/ref_row_iterators.h"
#include "sql/iterators/row_iterator.h"
#include "sql/iterators/timing_iterator.h"
#include "sql/join_optimizer/access_path.h"
#include "sql/join_optimizer/cost_model.h"
#include "sql/join_optimizer/join_optimizer.h"
#include "sql/key.h"
#include "sql/mysqld.h"
#include "sql/opt_explain_format.h"
#include "sql/opt_trace.h"
#include "sql/opt_trace_context.h"
#include "sql/parse_tree_nodes.h"
#include "sql/query_options.h"
#include "sql/query_result.h"
#include "sql/sql_class.h"
#include "sql/sql_const.h"
#include "sql/sql_error.h"
#include "sql/sql_executor.h"
#include "sql/sql_lex.h"
#include "sql/sql_list.h"
#include "sql/sql_opt_exec_shared.h"
#include "sql/sql_optimizer.h"
#include "sql/sql_select.h"
#include "sql/sql_test.h"
#include "sql/sql_tmp_table.h"
#include "sql/sql_union.h"
#include "sql/system_variables.h"
#include "sql/table.h"
#include "sql/temp_table_param.h"
#include "sql/thd_raii.h"
#include "sql/window.h"
#include "sql_string.h"
#include "string_with_len.h"
#include "template_utils.h"
Classes | |
class | Query_result_scalar_subquery |
Query result class for scalar and row subqueries. More... | |
class | Query_result_max_min_subquery |
class | Query_result_exists_subquery |
Functions | |
static bool | guaranteed_one_row (const Query_block *qb) |
Check if a query block is guaranteed to return one row. More... | |
static bool | wrapped_in_intersect_except (Query_term *qb) |
Check if a query block is part of an INTERSECT or EXCEPT set operation. More... | |
Item * | remove_in2exists_conds (Item *conds) |
Removes every predicate injected by IN->EXISTS. More... | |
bool | is_quantified_comp_predicate (Item *item) |
static Item ** | find_subquery_in_select_list (Query_block *select, Item_singlerow_subselect *subquery) |
Find the scalar subquery in Query_block::fields if directly present, i.e., not inside an expression. More... | |
bool | ExecuteExistsQuery (THD *thd, Query_expression *qe, RowIterator *iterator, bool *found) |
Run a query to see if it returns at least one row (stops after the first has been found, or on error). More... | |
static int | safe_index_read (TABLE *table, const Index_lookup &ref) |
Variables | |
static const enum_walk | walk_options |
Implements the subselect Item, used when there is a subselect in a SELECT list, WHERE, etc.
bool ExecuteExistsQuery | ( | THD * | thd, |
Query_expression * | qe, | ||
RowIterator * | iterator, | ||
bool * | found | ||
) |
Run a query to see if it returns at least one row (stops after the first has been found, or on error).
Unless there was an error, whether the row was found in "found".
true | on error |
|
static |
Find the scalar subquery in Query_block::fields if directly present, i.e., not inside an expression.
select | The query block owning the transformation. |
subquery | The scalar subquery to look for. |
|
static |
Check if a query block is guaranteed to return one row.
We know that this is the case if it has no tables and is not filtered with WHERE, HAVING or LIMIT clauses.
qb | the Query_block to check |
bool is_quantified_comp_predicate | ( | Item * | item | ) |
Removes every predicate injected by IN->EXISTS.
This function is different from others:
If there are no in2exists conditions, it will return the exact same pointer. If it returns a new Item, the old Item is left alone, so it can be reused in other settings.
conds | Condition; may be nullptr. |
|
static |
|
static |
Check if a query block is part of an INTERSECT or EXCEPT set operation.
qb | Query block to check |
|
static |