diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2017-11-08 15:47:49 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2017-11-09 09:31:03 +0100 |
commit | c2c93fc6e460fd32b6ef179686c2b3b2045f75eb (patch) | |
tree | e43f37d35eb5633e81cd8e9d42d55626c13ec2ed /sql/sql_derived.cc | |
parent | ca695888e00a4bdace1bc2143d91a0a871f39a6b (diff) | |
download | mariadb-git-c2c93fc6e460fd32b6ef179686c2b3b2045f75eb.tar.gz |
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.
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 4578bcec394..0aedf5084a9 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -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 || |