mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge
This commit is contained in:
@ -1943,6 +1943,45 @@ void st_lex::link_first_table_back(TABLE_LIST *first,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
cleanup lex for case when we open table by table for processing
|
||||
|
||||
SYNOPSIS
|
||||
st_lex::cleanup_after_one_table_open()
|
||||
*/
|
||||
|
||||
void st_lex::cleanup_after_one_table_open()
|
||||
{
|
||||
/*
|
||||
thd->lex->derived_tables & additional units may be set if we open
|
||||
a view. It is necessary to clear thd->lex->derived_tables flag
|
||||
to prevent processing of derived tables during next open_and_lock_tables
|
||||
if next table is a real table and cleanup & remove underlying units
|
||||
NOTE: all units will be connected to thd->lex->select_lex, because we
|
||||
have not UNION on most upper level.
|
||||
*/
|
||||
if (all_selects_list != &select_lex)
|
||||
{
|
||||
derived_tables= 0;
|
||||
/* cleunup underlying units (units of VIEW) */
|
||||
for (SELECT_LEX_UNIT *un= select_lex.first_inner_unit();
|
||||
un;
|
||||
un= un->next_unit())
|
||||
un->cleanup();
|
||||
/* reduce all selects list to default state */
|
||||
all_selects_list= &select_lex;
|
||||
/* remove underlying units (units of VIEW) subtree */
|
||||
select_lex.cut_subtree();
|
||||
}
|
||||
time_zone_tables_used= 0;
|
||||
if (spfuns.records)
|
||||
my_hash_reset(&spfuns);
|
||||
if (spprocs.records)
|
||||
my_hash_reset(&spprocs);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
fix some structures at the end of preparation
|
||||
|
||||
|
Reference in New Issue
Block a user