diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-02-23 08:43:34 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-02-23 08:43:34 +0100 |
commit | 2732fcc608eb98345f79ba805842ab02272d49cf (patch) | |
tree | e7273c809f44432e5f60a55d5b8f35253d49963d /sql/sql_cte.cc | |
parent | 131d9a5d0cb51fa88a0461c939dfd2a7c68d5664 (diff) | |
parent | b8af22af15d159b32256f7d5be8324871ae1a104 (diff) | |
download | mariadb-git-2732fcc608eb98345f79ba805842ab02272d49cf.tar.gz |
Merge branch 'bb-10.2-ext' into 10.3
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 61eaa535c00..a58a9254a82 100644 --- a/sql/sql_cte.cc +++ b/sql/sql_cte.cc @@ -926,12 +926,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); |