Commit 4f410473 authored by Sergei Golubchik's avatar Sergei Golubchik

post-merge: --ps-protocol fixes

parent f38c3521
......@@ -2054,7 +2054,9 @@ flush status;
create table t1(f1 char(1));
create view v1 as select * from t1;
select * from (select f1 as f2, f1 as f3 from v1) v where v.f2='a';
--disable_ps_protocol
show status like "Created_tmp%";
--enable_ps_protocol
drop view v1;
drop table t1;
......@@ -2063,7 +2065,9 @@ set @@optimizer_switch='derived_merge=OFF';
create table t1(f1 char(1));
create view v1 as select * from t1;
select * from (select f1 as f2, f1 as f3 from v1) v where v.f2='a';
--disable_ps_protocol
show status like "Created_tmp%";
--enable_ps_protocol
drop view v1;
drop table t1;
set @@optimizer_switch=@tmp;
......
......@@ -230,30 +230,30 @@ 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());
new_holder->fix_fields(thd, 0);
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment