1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt

into  moonbone.local:/work/19862-bug-5.0-opt-mysql


sql/item_func.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
This commit is contained in:
unknown
2006-07-26 00:37:35 +04:00
8 changed files with 81 additions and 1 deletions

View File

@ -1064,6 +1064,26 @@ JOIN::optimize()
{
need_tmp=1; simple_order=simple_group=0; // Force tmp table without sort
}
if (order)
{
/*
Force using of tmp table if sorting by a SP or UDF function due to
their expensive and probably non-deterministic nature.
*/
for (ORDER *tmp_order= order; tmp_order ; tmp_order=tmp_order->next)
{
Item *item= *tmp_order->item;
Item_func::Functype type=Item_func::FUNC_SP;
Item_func::Functype type1=Item_func::UDF_FUNC;
if (item->walk(&Item::func_type_checker_processor,(byte*)&type) ||
item->walk(&Item::func_type_checker_processor,(byte*)&type1))
{
/* Force tmp table without sort */
need_tmp=1; simple_order=simple_group=0;
break;
}
}
}
}
tmp_having= having;