mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-14164: Unknown column error when adding aggregate to function in oracle style procedure FOR loop
Make differentiation between pullout for merge and pulout of outer field during exists2in transformation. In last case the field was outer and so we can safely start from name resolution context of the SELECT where it was pulled. Old behavior lead to inconsistence between list of tables and outer name resolution context (which skips one SELECT for merge purposes) which creates problem vor name resolution.
This commit is contained in:
@ -466,7 +466,8 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived)
|
||||
// Update used tables cache according to new table map
|
||||
if (derived->on_expr)
|
||||
{
|
||||
derived->on_expr->fix_after_pullout(parent_lex, &derived->on_expr);
|
||||
derived->on_expr->fix_after_pullout(parent_lex, &derived->on_expr,
|
||||
TRUE);
|
||||
fix_list_after_tbl_changes(parent_lex, &derived->nested_join->join_list);
|
||||
}
|
||||
}
|
||||
@ -636,7 +637,8 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
|
||||
SELECT_LEX_UNIT *unit= derived->get_unit();
|
||||
DBUG_ENTER("mysql_derived_prepare");
|
||||
bool res= FALSE;
|
||||
DBUG_PRINT("enter", ("unit 0x%lx", (ulong) unit));
|
||||
DBUG_PRINT("enter", ("unit: %p table_list: %p Alias '%s'",
|
||||
unit, derived, derived->alias));
|
||||
|
||||
// Skip already prepared views/DT
|
||||
if (!unit || unit->prepared ||
|
||||
|
Reference in New Issue
Block a user