mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fixed optimizer bug in ORDER BY where some ORDER BY parts where ignored.
Extended default arguments to be up to 4095 characters Docs/manual.texi: Update lof LOCK TABLES mysql-test/r/order_by.result: Test for optimizer bug in ORDER BY mysql-test/t/order_by.test: Test for optimizer bug in ORDER BY mysys/default.c: Extended default arguments to be up to 4095 characters sql/sql_select.cc: Fixed optimizer bug in ORDER BY
This commit is contained in:
@ -2649,12 +2649,12 @@ static void update_depend_map(JOIN *join)
|
||||
for (i=0 ; i < ref->key_parts ; i++,item++)
|
||||
depend_map|=(*item)->used_tables();
|
||||
ref->depend_map=depend_map;
|
||||
for (JOIN_TAB *join_tab2=join->join_tab;
|
||||
for (JOIN_TAB **tab=join->map2table;
|
||||
depend_map ;
|
||||
join_tab2++,depend_map>>=1 )
|
||||
tab++,depend_map>>=1 )
|
||||
{
|
||||
if (depend_map & 1)
|
||||
ref->depend_map|=join_tab2->ref.depend_map;
|
||||
ref->depend_map|=(*tab)->ref.depend_map;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2671,12 +2671,12 @@ static void update_depend_map(JOIN *join, ORDER *order)
|
||||
order->depend_map=depend_map=order->item[0]->used_tables();
|
||||
if (!(order->depend_map & RAND_TABLE_BIT)) // Not item_sum() or RAND()
|
||||
{
|
||||
for (JOIN_TAB *join_tab=join->join_tab;
|
||||
for (JOIN_TAB **tab=join->map2table;
|
||||
depend_map ;
|
||||
join_tab++, depend_map>>=1)
|
||||
tab++, depend_map>>=1)
|
||||
{
|
||||
if (depend_map & 1)
|
||||
order->depend_map|=join_tab->ref.depend_map;
|
||||
order->depend_map|=(*tab)->ref.depend_map;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user