diff options
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index b3be1fc7338..a1481bb2522 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -508,7 +508,7 @@ void close_temporary_tables(THD *thd) */ query_buf_size+= table->key_length+1; - if ((query = alloc_root(&thd->mem_root, query_buf_size))) + if ((query = alloc_root(thd->mem_root, query_buf_size))) // Better add "if exists", in case a RESET MASTER has been done end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS "); @@ -2597,24 +2597,20 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields, List<Item> *sum_func_list, uint wild_num) { - Item *item; - DBUG_ENTER("setup_wild"); - if (!wild_num) - DBUG_RETURN(0); + return(0); - Item_arena *arena= thd->current_arena, backup; + Item *item; + List_iterator<Item> it(fields); + Item_arena *arena, backup; + DBUG_ENTER("setup_wild"); /* Don't use arena if we are not in prepared statements or stored procedures For PS/SP we have to use arena to remember the changes */ - if (arena->is_conventional()) - arena= 0; // For easier test later one - else - thd->set_n_backup_item_arena(arena, &backup); + arena= thd->change_arena_if_needed(&backup); - List_iterator<Item> it(fields); while (wild_num && (item= it++)) { if (item->type() == Item::FIELD_ITEM && @@ -3108,7 +3104,7 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) } if (arena) - thd->set_n_backup_item_arena(arena, &backup); + arena= thd->change_arena_if_needed(&backup); TABLE *t1=tab1->table; TABLE *t2=tab2->table; @@ -3209,7 +3205,7 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) embedding->nested_join->join_list.head() == embedded); } - if (arena) + if (!thd->current_arena->is_conventional()) { /* We are in prepared statement preparation code => we should store |