Skip to content

Commit 0156178

Browse files
committed
MariaRocks port: fix a typo in test_if_order_by_key()
- Off-by-one error in handler->index_flags() parameter caused it to be called for the keypart that's after the last key part.
1 parent 680a206 commit 0156178

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/sql_select.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20569,7 +20569,7 @@ static int test_if_order_by_key(JOIN *join,
2056920569
key_parts= (uint) (key_part - table->key_info[idx].key_part);
2057020570

2057120571
if (reverse == -1 &&
20572-
!(table->file->index_flags(idx, user_defined_kp, 1) & HA_READ_PREV))
20572+
!(table->file->index_flags(idx, user_defined_kp-1, 1) & HA_READ_PREV))
2057320573
reverse= 0; // Index can't be used
2057420574

2057520575
if (have_pk_suffix && reverse == -1)

0 commit comments

Comments
 (0)