summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <gshchepa/uchum@gleb.loc>2007-07-28 23:47:02 +0500
committerunknown <gshchepa/uchum@gleb.loc>2007-07-28 23:47:02 +0500
commit0c161e15b040bde9ba23c8865028270008092e35 (patch)
tree3c3d0aa4ebcdfbbc7b76a8f1e15b7783006bdb9d /sql
parentc8d0796c3b16abb4dd2b01a1e1e61363cdd84c44 (diff)
parent953248898d4abeb1c19fee8176b243399a9f3610 (diff)
downloadmariadb-git-0c161e15b040bde9ba23c8865028270008092e35.tar.gz
Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into gleb.loc:/home/uchum/work/bk/5.0-opt
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_base.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 911e8d4d1f5..7098f8ece55 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3428,7 +3428,7 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list,
table_list->alias, name, item_name, (ulong) ref));
Field_iterator_view field_it;
field_it.set(table_list);
- Query_arena *arena, backup;
+ Query_arena *arena= 0, backup;
DBUG_ASSERT(table_list->schema_table_reformed ||
(ref != 0 && table_list->view != 0));
@@ -3437,14 +3437,14 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list,
if (!my_strcasecmp(system_charset_info, field_it.name(), name))
{
// in PS use own arena or data will be freed after prepare
- if (register_tree_change)
+ if (register_tree_change && thd->stmt_arena->is_stmt_prepare_or_first_sp_execute())
arena= thd->activate_stmt_arena_if_needed(&backup);
/*
create_item() may, or may not create a new Item, depending on
the column reference. See create_view_field() for details.
*/
Item *item= field_it.create_item(thd);
- if (register_tree_change && arena)
+ if (arena)
thd->restore_active_arena(arena, &backup);
if (!item)