summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-12-10 17:51:07 +0200
committermonty@hundin.mysql.fi <>2001-12-10 17:51:07 +0200
commit12058c299647533050950d1dd5952c666c2eceb2 (patch)
tree40df440fc1708f1f09301e5f4f923c08a4470ec9 /mysql-test/t
parent0f71e337b32c3388070f96160234df86eae964f8 (diff)
downloadmariadb-git-12058c299647533050950d1dd5952c666c2eceb2.tar.gz
Fixed bug in GROUP BY ... DESC
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/group_by.test25
1 files changed, 24 insertions, 1 deletions
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index e75841dc6d0..efa1744feee 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -38,7 +38,6 @@ INSERT INTO t2 VALUES (3,'name','pass','mail','Y','v','n','adr','1','1','1');
SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid;
SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid;
SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid;
-
drop table test.t1,test.t2;
#
@@ -220,3 +219,27 @@ select 1+1, "a",count(*) from t1 where foo in (2);
insert into t1 values (1);
select 1+1,"a",count(*) from t1 where foo in (2);
drop table t1;
+
+#
+# Test GROUP BY DESC
+
+CREATE TABLE t1 (
+ spID int(10) unsigned,
+ userID int(10) unsigned,
+ score smallint(5) unsigned,
+ key (spid),
+ key (score)
+);
+
+INSERT INTO t1 VALUES (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3);
+explain select userid,count(*) from t1 group by userid desc;
+select userid,count(*) from t1 group by userid desc;
+explain select spid,count(*) from t1 where spid between 1 and 2 group by spid desc;
+explain select spid,count(*) from t1 where spid between 1 and 2 group by spid;
+select spid,count(*) from t1 where spid between 1 and 2 group by spid;
+select spid,count(*) from t1 where spid between 1 and 2 group by spid desc;
+explain select sql_big_result spid,sum(userid) from t1 group by spid desc;
+select sql_big_result spid,sum(userid) from t1 group by spid desc;
+explain select sql_big_result score,count(*) from t1 group by score desc;
+select sql_big_result score,count(*) from t1 group by score desc;
+drop table t1;