summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-01-14 20:55:33 +0100
committerSergei Golubchik <serg@mariadb.org>2017-01-15 00:11:50 +0100
commit798fcb541698cbf51f1ee33f44b023c11dc2b784 (patch)
tree12a47741ef63500d339a1e076cafa500a03498b0 /sql/table.cc
parent67e2028161d1f653a852f1a4679ff5e523296218 (diff)
downloadmariadb-git-798fcb541698cbf51f1ee33f44b023c11dc2b784.tar.gz
bugfix: cmp_item_row::alloc_comparators() allocated on the wrong arena
it used current_thd->alloc() and allocated on the thd's execution arena, not on table->expr_arena. Remove THD::arena_for_cached_items that is temporarily set in update_virtual_fields(), and replaces THD arena in get_datetime_value(). Instead set THD arena to table->expr_arena for the whole duration of update_virtual_fields()
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 1330560b6b6..9d52d5f87a2 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -6575,7 +6575,9 @@ int update_virtual_fields(THD *thd, TABLE *table,
int error __attribute__ ((unused))= 0;
DBUG_ASSERT(table && table->vfield);
- thd->reset_arena_for_cached_items(table->expr_arena);
+ Query_arena backup_arena;
+ thd->set_n_backup_active_arena(table->expr_arena, &backup_arena);
+
/* Iterate over virtual fields in the table */
for (vfield_ptr= table->vfield; *vfield_ptr; vfield_ptr++)
{
@@ -6593,7 +6595,7 @@ int update_virtual_fields(THD *thd, TABLE *table,
DBUG_PRINT("info", ("field '%s' - skipped", vfield->field_name));
}
}
- thd->reset_arena_for_cached_items(0);
+ thd->restore_active_arena(table->expr_arena, &backup_arena);
DBUG_RETURN(0);
}