1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge magare.gmz:/home/kgeorge/mysql/work/B31001-5.0-opt

into  magare.gmz:/home/kgeorge/mysql/work/B31001-5.1-opt
This commit is contained in:
gkodinov/kgeorge@magare.gmz
2007-09-14 19:03:14 +03:00
3 changed files with 127 additions and 1 deletions

View File

@ -12353,6 +12353,12 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
for (; const_key_parts & 1 ; const_key_parts>>= 1)
key_part++;
/*
The primary and secondary key parts were all const (i.e. there's
one row). The sorting doesn't matter.
*/
if (key_part == key_part_end && reverse == 0)
DBUG_RETURN(1);
}
else
DBUG_RETURN(0);
@ -12995,7 +13001,7 @@ check_reverse_order:
select->quick=tmp;
}
}
else if (tab->ref.key >= 0 && tab->ref.key_parts < used_key_parts)
else if (tab->ref.key >= 0 && tab->ref.key_parts <= used_key_parts)
{
/*
SELECT * FROM t1 WHERE a=1 ORDER BY a DESC,b DESC