summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2004-09-30 21:36:25 +0000
committerunknown <tomas@poseidon.ndb.mysql.com>2004-09-30 21:36:25 +0000
commitf5f55979f492908efa8d0aeeb8f289138e3775d9 (patch)
treeec7ecf106e7653549817ab34bf90690a9692194d /sql/sql_select.cc
parent8a63a0b587c15c5ca87fb290d8e2c330acdcc6c0 (diff)
downloadmariadb-git-f5f55979f492908efa8d0aeeb8f289138e3775d9.tar.gz
bug#5782
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 1112e073cb1..5d912b441df 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -7188,11 +7188,13 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
for (nr=0; nr < table->keys ; nr++)
{
- uint not_used;
+ uint used_key_parts;
if (keys.is_set(nr))
{
int flag;
- if ((flag=test_if_order_by_key(order, table, nr, &not_used)))
+ if ((flag=test_if_order_by_key(order, table, nr, &used_key_parts)) > 0 ||
+ ((flag < 0) && (table->file->index_flags(nr,used_key_parts-1, 1)
+ & HA_READ_PREV)))
{
if (!no_changes)
{