summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2004-01-19 21:06:27 +0400
committerunknown <hf@deer.(none)>2004-01-19 21:06:27 +0400
commitb44c819bb61664b4b69680c0209b8627b40fe2b2 (patch)
tree68d020ad65ffc40d49179abe19fb94245bfbf5d6 /sql/item_subselect.cc
parent584e137887326584e1f24d2061e75486d745584e (diff)
parent9af09d1266c5a354e6126f13feaea0a3680442d3 (diff)
downloadmariadb-git-b44c819bb61664b4b69680c0209b8627b40fe2b2.tar.gz
Merge deer.(none):/home/hf/work/mysql-4.1.clean
into deer.(none):/home/hf/work/mysql-4.1.1676 sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_subselect.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index e0d9bcf3bd6..518b712ad18 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -306,8 +306,6 @@ void Item_singlerow_subselect::fix_length_and_dec()
if ((max_columns= engine->cols()) == 1)
{
engine->fix_length_and_dec(row= &value);
- if (!(value= Item_cache::get_cache(engine->type())))
- return;
}
else
{
@@ -919,7 +917,8 @@ int subselect_single_select_engine::prepare()
{
if (prepared)
return 0;
- join= new JOIN(thd, select_lex->item_list, select_lex->options, result);
+ join= new JOIN(thd, select_lex->item_list,
+ select_lex->options | SELECT_NO_UNLOCK, result);
if (!join || !result)
{
thd->fatal_error(); //out of memory
@@ -946,7 +945,7 @@ int subselect_single_select_engine::prepare()
int subselect_union_engine::prepare()
{
- return unit->prepare(thd, result);
+ return unit->prepare(thd, result, SELECT_NO_UNLOCK);
}
int subselect_uniquesubquery_engine::prepare()
@@ -968,13 +967,9 @@ static Item_result set_row(List<Item> &item_list, Item *item,
res_type= sel_item->result_type();
item->decimals= sel_item->decimals;
*maybe_null= sel_item->maybe_null;
- if (row)
- {
- if (!(row[i]= Item_cache::get_cache(res_type)))
- return STRING_RESULT; // we should return something
- row[i]->set_len_n_dec(sel_item->max_length, sel_item->decimals);
- row[i]->collation.set(sel_item->collation);
- }
+ if (!(row[i]= Item_cache::get_cache(res_type)))
+ return STRING_RESULT; // we should return something
+ row[i]->setup(sel_item);
}
if (item_list.elements > 1)
res_type= ROW_RESULT;
@@ -995,7 +990,10 @@ void subselect_union_engine::fix_length_and_dec(Item_cache **row)
DBUG_ASSERT(row || unit->first_select()->item_list.elements==1);
if (unit->first_select()->item_list.elements == 1)
+ {
res_type= set_row(unit->types, item, row, &maybe_null);
+ item->collation.set(row[0]->collation);
+ }
else
{
bool fake= 0;