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

Bug #42760: Select doesn't return desired results when we have null values

Part 2 : 
There was a special optimization on the ref access method for 
ORDER BY ... DESC that was set without actually looking on the type of the 
selected index for ORDER BY.
Fixed the SELECT ... ORDER BY .. DESC (it uses a different code path compared
to the ASC that has been fixed with the previous fix).
This commit is contained in:
Georgi Kodinov
2009-12-07 16:38:56 +02:00
parent 36e019c933
commit bd308d1256
3 changed files with 19 additions and 1 deletions

View File

@ -12824,7 +12824,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
}
DBUG_RETURN(1);
}
if (tab->ref.key_parts <= used_key_parts)
if (tab->ref.key_parts <= used_key_parts && tab->type == JT_REF)
{
/*
SELECT * FROM t1 WHERE a=1 ORDER BY a DESC,b DESC