diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-02-22 19:29:52 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-02-22 19:29:52 +0100 |
commit | b8af22af15d159b32256f7d5be8324871ae1a104 (patch) | |
tree | 402a26f282e91562b17c07c12d3d6c017d63ef87 /sql/sql_cte.cc | |
parent | 868bca5c4fca7ca3fcddf9195800bc1ef5988885 (diff) | |
parent | e92cc097658405fdb52c80254b933424f8c1f99e (diff) | |
download | mariadb-git-b8af22af15d159b32256f7d5be8324871ae1a104.tar.gz |
Merge branch '10.2' into bb-10.2-ext
Diffstat (limited to 'sql/sql_cte.cc')
-rw-r--r-- | sql/sql_cte.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc index 23a3eba1615..6581113df80 100644 --- a/sql/sql_cte.cc +++ b/sql/sql_cte.cc @@ -909,12 +909,19 @@ With_element::rename_columns_of_derived_unit(THD *thd, my_error(ER_WITH_COL_WRONG_LIST, MYF(0)); return true; } + + Query_arena *arena, backup; + arena= thd->activate_stmt_arena_if_needed(&backup); + /* Rename the columns of the first select in the unit */ while ((item= it++, name= nm++)) { item->set_name(thd, name->str, (uint) name->length, system_charset_info); item->is_autogenerated_name= false; } + + if (arena) + thd->restore_active_arena(arena, &backup); } else make_valid_column_names(thd, select->item_list); |