1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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.
This commit is contained in:
unknown
2002-03-02 09:51:24 +02:00
parent ae670b7666
commit ad4fcb8a01
13 changed files with 144 additions and 36 deletions

View File

@ -77,6 +77,7 @@ public:
void reset(void) { next=0; it.rewind(); }
int init() { return error=file->index_init(index); }
virtual int get_next();
virtual bool reverse_sorted() { return 0; }
int cmp_next(QUICK_RANGE *range);
bool unique_key_range();
};
@ -87,6 +88,7 @@ class QUICK_SELECT_DESC: public QUICK_SELECT
public:
QUICK_SELECT_DESC(QUICK_SELECT *q, uint used_key_parts);
int get_next();
bool reverse_sorted() { return 1; }
private:
int cmp_prev(QUICK_RANGE *range);
bool range_reads_after_key(QUICK_RANGE *range);
@ -96,6 +98,7 @@ private:
List_iterator<QUICK_RANGE> rev_it;
};
class SQL_SELECT :public Sql_alloc {
public:
QUICK_SELECT *quick; // If quick-select used