summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.fi>2002-03-02 09:51:24 +0200
committerunknown <monty@tik.mysql.fi>2002-03-02 09:51:24 +0200
commitad4fcb8a01f297f914e9e75d44b04e10fd91eb97 (patch)
tree7c46a4aab7560f176209fe10d40e1ec2df488a46 /sql/opt_range.cc
parentae670b76660fd66d046fd96af88be303c1d91006 (diff)
downloadmariadb-git-ad4fcb8a01f297f914e9e75d44b04e10fd91eb97.tar.gz
Fix sorting of NULL values (Should always be first)
Fix problem with HAVING and MAX() IS NOT NULL Docs/manual.texi: Changelog & NULL usage with ORDER BY client/mysqldump.c: Cleanup disable keys mysql-test/r/distinct.result: Fix results after ORDER BY with NULL fix mysql-test/r/group_by.result: Fix results after ORDER BY with NULL fix mysql-test/r/having.result: Testcase for bug with HAVING mysql-test/t/distinct.test: Test for DISTINCT + ORDER BY DESC bug mysql-test/t/having.test: Test of HAVING and MAX IS NOT NULL sql/filesort.cc: Fix sorting of NULL values (Should always be first) sql/item.h: Fix problem with HAVING and MAX() IS NOT NULL sql/item_sum.h: Fix problem with HAVING and MAX() IS NOT NULL sql/opt_range.cc: Fix problem with HAVING and MAX() IS NOT NULL sql/opt_range.h: Fix sorting of NULL values sql/sql_select.cc: Fix sorting of ORDER BY ... DESC on NULL values.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index c3f4c91b718..20f198182f4 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -2523,13 +2523,13 @@ int QUICK_SELECT::cmp_next(QUICK_RANGE *range)
/*
- * This is a hack: we inherit from QUICK_SELECT so that we can use the
- * get_next() interface, but we have to hold a pointer to the original
- * QUICK_SELECT because its data are used all over the place. What
- * should be done is to factor out the data that is needed into a base
- * class (QUICK_SELECT), and then have two subclasses (_ASC and _DESC)
- * which handle the ranges and implement the get_next() function. But
- * for now, this seems to work right at least.
+ This is a hack: we inherit from QUICK_SELECT so that we can use the
+ get_next() interface, but we have to hold a pointer to the original
+ QUICK_SELECT because its data are used all over the place. What
+ should be done is to factor out the data that is needed into a base
+ class (QUICK_SELECT), and then have two subclasses (_ASC and _DESC)
+ which handle the ranges and implement the get_next() function. But
+ for now, this seems to work right at least.
*/
QUICK_SELECT_DESC::QUICK_SELECT_DESC(QUICK_SELECT *q, uint used_key_parts)
@@ -2538,6 +2538,7 @@ QUICK_SELECT_DESC::QUICK_SELECT_DESC(QUICK_SELECT *q, uint used_key_parts)
bool not_read_after_key = file->option_flag() & HA_NOT_READ_AFTER_KEY;
QUICK_RANGE *r;
+ it.rewind();
for (r = it++; r; r = it++)
{
rev_ranges.push_front(r);