summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-08-05 18:10:53 +0300
committerunknown <monty@mashka.mysql.fi>2002-08-05 18:10:53 +0300
commit529e1af2957828c4b8570933547b7202c8a36878 (patch)
tree35b9b7d0d96ac96efa5d2dc6ab3a58ef497f1a6a /mysql-test
parent19c6bdba3bc57e68cdf72e8a4c23ded552fcd089 (diff)
downloadmariadb-git-529e1af2957828c4b8570933547b7202c8a36878.tar.gz
Fixed bug with GROUP BY on NULL fields.
(Merge of code from 4.0) Docs/manual.texi: Changelog include/my_base.h: Fixed bug with GROUP BY on NULL fields. include/mysql_com.h: Fixed bug with GROUP BY on NULL fields. myisam/mi_search.c: Fixed bug with GROUP BY on NULL fields. myisam/mi_write.c: Fixed bug with GROUP BY on NULL fields. mysql-test/r/group_by.result: Fixed bug with GROUP BY on NULL fields. mysql-test/t/group_by.test: Fixed bug with GROUP BY on NULL fields. sql/sql_base.cc: Removed some not-needed comments in the trace file sql/sql_select.cc: Fixed bug with GROUP BY on NULL fields.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/group_by.result16
-rw-r--r--mysql-test/t/group_by.test11
2 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index aafeb64ee2a..200cbc29b08 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -68,3 +68,19 @@ One Two sum(Four)
1 1 16
1 2 16
1 3 16
+xID xID1
+1 1
+2 2
+2 2
+3 134
+3 134
+3 134
+4 185
+4 185
+4 185
+4 185
+xID xID1 Level
+1 1 *
+2 2 **
+3 134 ***
+4 185 ****
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 11408511e99..dfbb2f325a9 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -259,3 +259,14 @@ insert into t1 values (1,3,3,4);
insert into t1 values (1,3,4,4);
select One, Two, sum(Four) from t1 group by One,Two;
drop table if exists t1;
+
+#
+# The GROUP BY returned rows in wrong order in 3.23.51
+#
+
+CREATE TABLE t1 (ID1 int, ID2 int, ID int NOT NULL AUTO_INCREMENT,PRIMARY KEY(ID
+));
+insert into t1 values (1,244,NULL),(2,243,NULL),(134,223,NULL),(185,186,NULL);
+select S.ID as xID, S.ID1 as xID1 from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2;
+select S.ID as xID, S.ID1 as xID1, repeat('*',count(distinct yS.ID)) as Level from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2 group by xID order by xID1;
+drop table t1;