summaryrefslogtreecommitdiff
path: root/sql/sql_tvc.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-03-20 10:26:49 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-03-20 10:41:32 +0200
commit514b305dfb2839c619a623bbdae5f21cf0077672 (patch)
tree2f9700f05ccf0ddc7e46a547d9a191404e8dbbd7 /sql/sql_tvc.cc
parentde51acd03730311505677eb7212756e7126183b3 (diff)
parent117291db8b35ddb4cd8c89ee4d8de888160b7163 (diff)
downloadmariadb-git-514b305dfb2839c619a623bbdae5f21cf0077672.tar.gz
Merge 10.3 into 10.4
The MDEV-17262 commit 26432e49d37a37d09b862bb49a021e44bdf4789c was skipped. In Galera 4, the implementation would seem to require changes to the streaming replication. In the tests archive.rnd_pos main.profiling, disable_ps_protocol for SHOW STATUS and SHOW PROFILE commands until MDEV-18974 has been fixed.
Diffstat (limited to 'sql/sql_tvc.cc')
-rw-r--r--sql/sql_tvc.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc
index 0e4caae7a2f..f16d34e8041 100644
--- a/sql/sql_tvc.cc
+++ b/sql/sql_tvc.cc
@@ -230,29 +230,29 @@ bool table_value_constr::prepare(THD *thd, SELECT_LEX *sl,
if (fix_fields_for_tvc(thd, li))
DBUG_RETURN(true);
- if (!(holders= new (thd->mem_root)
- Type_holder[cnt]) ||
- join_type_handlers_for_tvc(thd, li, holders,
- cnt) ||
+ if (!(holders= new (thd->stmt_arena->mem_root) Type_holder[cnt]) ||
+ join_type_handlers_for_tvc(thd, li, holders, cnt) ||
get_type_attributes_for_tvc(thd, li, holders,
lists_of_values.elements, cnt))
DBUG_RETURN(true);
List_iterator_fast<Item> it(*first_elem);
Item *item;
+ Query_arena *arena, backup;
+ arena=thd->activate_stmt_arena_if_needed(&backup);
sl->item_list.empty();
for (uint pos= 0; (item= it++); pos++)
{
/* Error's in 'new' will be detected after loop */
Item_type_holder *new_holder= new (thd->mem_root)
- Item_type_holder(thd,
- item,
- holders[pos].type_handler(),
+ Item_type_holder(thd, item, holders[pos].type_handler(),
&holders[pos]/*Type_all_attributes*/,
holders[pos].get_maybe_null());
sl->item_list.push_back(new_holder);
}
+ if (arena)
+ thd->restore_active_arena(arena, &backup);
if (unlikely(thd->is_fatal_error))
DBUG_RETURN(true); // out of memory