summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-12-07 16:38:56 +0200
committerGeorgi Kodinov <joro@sun.com>2009-12-07 16:38:56 +0200
commit3c434c93d0348629ae9cf369919aa6a845bade93 (patch)
tree3066c35674fd3b5e8ffd1c3be84542e1a837fb23 /sql/sql_select.cc
parent89ea92505f73f0c089c42a3ba9c58a2565db9cca (diff)
downloadmariadb-git-3c434c93d0348629ae9cf369919aa6a845bade93.tar.gz
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).
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 9f0843fe0db..f655db0fc32 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -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