summaryrefslogtreecommitdiff
path: root/mysql-test/t/distinct.test
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
commit6cfc5e0eb2a0931903ecffb6d438f5dc6ea011f0 (patch)
tree7c46a4aab7560f176209fe10d40e1ec2df488a46 /mysql-test/t/distinct.test
parent7d94ef80c4215fa7dee199bfd19354595c1f6ed8 (diff)
downloadmariadb-git-6cfc5e0eb2a0931903ecffb6d438f5dc6ea011f0.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 'mysql-test/t/distinct.test')
-rw-r--r--mysql-test/t/distinct.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index bf8a03ac40d..b850ec5d562 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -207,3 +207,14 @@ insert into t1 (a) values (1),(2),(3),(4),(1),(2),(3),(4);
select distinct a from t1 group by b,a having a > 2 order by a desc;
select distinct a,c from t1 group by b,c,a having a > 2 order by a desc;
drop table t1;
+
+#
+# Test problem with DISTINCT and ORDER BY DESC
+#
+
+create table t1 (a char(1), key(a)) type=myisam;
+insert into t1 values('1'),('1');
+select * from t1 where a >= '1';
+select distinct a from t1 order by a desc;
+select distinct a from t1 where a >= '1' order by a desc;
+drop table t1;