diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2016-04-09 17:03:48 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2016-04-09 17:03:48 +0200 |
commit | cd776fedba3e2902bc25ee206d6e6266e7eb9411 (patch) | |
tree | 95bf82d0e0522c6af708cd28639c82e004b5a264 /sql/sql_derived.cc | |
parent | f884d233e6a5f68bab846a7bdbd041fc4415ad77 (diff) | |
parent | d516a2ae0cbd09d3b5b1667ec62b421330ab9902 (diff) | |
download | mariadb-git-10.2-connector-c-integ.tar.gz |
Merge branch '10.2' into 10.2-connector-c-integ10.2-connector-c-integ
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index baba4a876b3..1ef83b3bf1f 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -30,6 +30,7 @@ #include "sql_base.h" #include "sql_view.h" // check_duplicate_names #include "sql_acl.h" // SELECT_ACL +#include "sql_cte.h" typedef bool (*dt_processor)(THD *thd, LEX *lex, TABLE_LIST *derived); @@ -670,6 +671,9 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) // st_select_lex_unit::prepare correctly work for single select if ((res= unit->prepare(thd, derived->derived_result, 0))) goto exit; + if (derived->with && + (res= derived->with->rename_columns_of_derived_unit(thd, unit))) + goto exit; lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_DERIVED; if ((res= check_duplicate_names(thd, unit->types, 0))) goto exit; |