MySQL 9.1.0
Source Code Documentation
|
Instances of Name_resolution_context store the information necessary for name resolution of Items and other context analysis of a query made in fix_fields(). More...
#include <item.h>
Public Member Functions | |
void | resolve_in_table_list_only (Table_ref *tables) |
Public Attributes | |
Name_resolution_context * | outer_context {nullptr} |
The name resolution context to search in when an Item cannot be resolved in this context (the context of an outer select) More... | |
Name_resolution_context * | next_context {nullptr} |
Link to next name res context with the same query block as the base. More... | |
Table_ref * | table_list {nullptr} |
List of tables used to resolve the items of this context. More... | |
Table_ref * | first_name_resolution_table {nullptr} |
In most cases the two table references below replace 'table_list' above for the purpose of name resolution. More... | |
Table_ref * | last_name_resolution_table {nullptr} |
Last table to search in the list of leaf table references that begins with first_name_resolution_table. More... | |
Query_block * | query_block {nullptr} |
Query_block item belong to, in case of merged VIEW it can differ from Query_block where item was created, so we can't use table_list/field_list from there. More... | |
bool | view_error_handler {false} |
Table_ref * | view_error_handler_arg {nullptr} |
bool | resolve_in_select_list {false} |
When true, items are resolved in this context against Query_block::item_list, SELECT_lex::group_list and this->table_list. More... | |
Security_context * | security_ctx {nullptr} |
Security context of this name resolution context. More... | |
Instances of Name_resolution_context store the information necessary for name resolution of Items and other context analysis of a query made in fix_fields().
This structure is a part of Query_block, a pointer to this structure is assigned when an item is created (which happens mostly during parsing (sql_yacc.yy)), but the structure itself will be initialized after parsing is complete
|
inline |
In most cases the two table references below replace 'table_list' above for the purpose of name resolution.
The first and last name resolution table references allow us to search only in a sub-tree of the nested join tree in a FROM clause. This is needed for NATURAL JOIN, JOIN ... USING and JOIN ... ON.
Last table to search in the list of leaf table references that begins with first_name_resolution_table.
Name_resolution_context* Name_resolution_context::next_context {nullptr} |
Link to next name res context with the same query block as the base.
Name_resolution_context* Name_resolution_context::outer_context {nullptr} |
The name resolution context to search in when an Item cannot be resolved in this context (the context of an outer select)
Query_block* Name_resolution_context::query_block {nullptr} |
Query_block item belong to, in case of merged VIEW it can differ from Query_block where item was created, so we can't use table_list/field_list from there.
bool Name_resolution_context::resolve_in_select_list {false} |
When true, items are resolved in this context against Query_block::item_list, SELECT_lex::group_list and this->table_list.
If false, items are resolved only against this->table_list.
Security_context* Name_resolution_context::security_ctx {nullptr} |
Security context of this name resolution context.
It's used for views and is non-zero only if the view is defined with SQL SECURITY DEFINER.
List of tables used to resolve the items of this context.
Usually these are tables from the FROM clause of SELECT statement. The exceptions are INSERT ... SELECT and CREATE ... SELECT statements, where SELECT subquery is not moved to a separate Query_block. For these types of statements we have to change this member dynamically to ensure correct name resolution of different parts of the statement.
bool Name_resolution_context::view_error_handler {false} |