summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorunknown <ram@gw.mysql.r18.ru>2003-12-25 18:50:22 +0400
committerunknown <ram@gw.mysql.r18.ru>2003-12-25 18:50:22 +0400
commit17e54cf40702918c5f9b932a2416619ad88e12e7 (patch)
tree8cec7571abd240e73a154087e0368a09859235bd /sql/item_subselect.cc
parent509d5cf39108724e3bd16264b2867a54c4ae6d3a (diff)
downloadmariadb-git-17e54cf40702918c5f9b932a2416619ad88e12e7.tar.gz
Fix for the bug #2198: SELECT INTO OUTFILE (with Sub-Select) Problem.
Proper Item_cache::setup() method. Code cleanup. (discussed with sanja) sql/item.cc: code cleanup sql/item.h: fix for the bug #2198: SELECT INTO OUTFILE (with Sub-Select) Problem. proper Item_cache::setup() method code cleanup sql/item_subselect.cc: fix for the bug #2198: SELECT INTO OUTFILE (with Sub-Select) Problem. proper Item_cache::setup() method code cleanup
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 43775e1c96c..cb729041f22 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -301,8 +301,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
{
@@ -955,13 +953,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;
@@ -982,7 +976,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;