mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
merging
This commit is contained in:
@ -917,10 +917,10 @@ select_subselect::select_subselect(Item_subselect *item)
|
||||
this->item=item;
|
||||
}
|
||||
|
||||
bool select_singleval_subselect::send_data(List<Item> &items)
|
||||
bool select_singlerow_subselect::send_data(List<Item> &items)
|
||||
{
|
||||
DBUG_ENTER("select_singleval_subselect::send_data");
|
||||
Item_singleval_subselect *it= (Item_singleval_subselect *)item;
|
||||
DBUG_ENTER("select_singlerow_subselect::send_data");
|
||||
Item_singlerow_subselect *it= (Item_singlerow_subselect *)item;
|
||||
if (it->assigned())
|
||||
{
|
||||
my_message(ER_SUBSELECT_NO_1_ROW, ER(ER_SUBSELECT_NO_1_ROW), MYF(0));
|
||||
@ -932,32 +932,9 @@ bool select_singleval_subselect::send_data(List<Item> &items)
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
List_iterator_fast<Item> li(items);
|
||||
Item *val_item= li++; // Only one (single value subselect)
|
||||
/*
|
||||
Following val() call have to be first, because function AVG() & STD()
|
||||
calculate value on it & determinate "is it NULL?".
|
||||
*/
|
||||
it->real_value= val_item->val_result();
|
||||
if ((it->null_value= val_item->null_value))
|
||||
{
|
||||
it->reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
it->max_length= val_item->max_length;
|
||||
it->decimals= val_item->decimals;
|
||||
it->set_charset(val_item->charset());
|
||||
it->int_value= val_item->val_int_result();
|
||||
String *s= val_item->str_result(&it->string_value);
|
||||
if (s != &it->string_value)
|
||||
{
|
||||
it->string_value.set(*s, 0, s->length());
|
||||
}
|
||||
// TODO: remove when correct charset handling appeared for Item
|
||||
it->str_value.set(*s, 0, s->length()); // store charset
|
||||
|
||||
it->res_type= val_item->result_type();
|
||||
}
|
||||
Item *val_item;
|
||||
for (uint i= 0; (val_item= li++); i++)
|
||||
it->store(i, val_item);
|
||||
it->assigned(1);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user