diff options
author | Georgi Kodinov <kgeorge@mysql.com> | 2008-07-16 12:31:50 +0300 |
---|---|---|
committer | Georgi Kodinov <kgeorge@mysql.com> | 2008-07-16 12:31:50 +0300 |
commit | 59ab9a0872ab5e91cc85da55ee610a6d6f6bcf0c (patch) | |
tree | a6746e285208320fb4096bebcf7c4450dd5b6146 /sql/opt_range.h | |
parent | 52f510ef22d1ebb518467bdb0d29f3cb7a3e77b1 (diff) | |
download | mariadb-git-59ab9a0872ab5e91cc85da55ee610a6d6f6bcf0c.tar.gz |
Bug#37830 : ORDER BY ASC/DESC - no difference
Range scan in descending order for c <= <col> <= c type of
ranges was ignoring the DESC flag.
However some engines like InnoDB have the primary key parts
as a suffix for every secondary key.
When such primary key suffix is used for ordering ignoring
the DESC is not valid.
But we generally would like to do this because it's faster.
Fixed by performing only reverse scan if the primary key is used.
Removed some dead code in the process.
Diffstat (limited to 'sql/opt_range.h')
-rw-r--r-- | sql/opt_range.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h index 3a737323eb7..8856223b371 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -667,12 +667,10 @@ public: int get_type() { return QS_TYPE_RANGE_DESC; } private: bool range_reads_after_key(QUICK_RANGE *range); -#ifdef NOT_USED - bool test_if_null_range(QUICK_RANGE *range, uint used_key_parts); -#endif int reset(void) { rev_it.rewind(); return QUICK_RANGE_SELECT::reset(); } List<QUICK_RANGE> rev_ranges; List_iterator<QUICK_RANGE> rev_it; + uint used_key_parts; }; |