1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

new subselect tests

LIMIT fixed
AVG & STD with subselect fixed
join_free fixed to be depended queries compatible
sort_default removed from SELECT_LEX


mysql-test/r/subselect.result:
  new subselect tests
mysql-test/t/subselect.test:
  new subselect tests
sql/item.cc:
  marking as depended _ALL_ subselects under select from wich depend
sql/item_subselect.cc:
  limit fixed
  TODO added
sql/sql_class.cc:
  AVG & STD function with subselects fixed
sql/sql_lex.h:
  sort_default removed
sql/sql_parse.cc:
  limit fixed
sql/sql_select.cc:
  fixed to be subselect compatible
sql/sql_yacc.yy:
  sort_default removed
This commit is contained in:
unknown
2002-06-01 23:35:36 +03:00
parent 56f154165c
commit a532bfb2ea
9 changed files with 75 additions and 29 deletions

View File

@@ -790,11 +790,17 @@ bool select_subselect::send_data(List<Item> &items)
DBUG_RETURN(1);
}
if (unit->offset_limit_cnt)
{ // using limit offset,count
{ // Using limit offset,count
unit->offset_limit_cnt--;
DBUG_RETURN(0);
}
Item *val_item= (Item *)item->select_lex->item_list.head();
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?".
*/
item->real_value= val_item->val();
if ((item->null_value= val_item->is_null()))
{
item->assign_null();
@@ -804,7 +810,6 @@ bool select_subselect::send_data(List<Item> &items)
item->binary= val_item->binary;
val_item->val_str(&item->str_value);
item->int_value= val_item->val_int();
item->real_value= val_item->val();
item->res_type= val_item->result_type();
}
item->executed= 1;