diff options
author | monty@donna.mysql.com <> | 2001-01-28 21:35:50 +0200 |
---|---|---|
committer | monty@donna.mysql.com <> | 2001-01-28 21:35:50 +0200 |
commit | ce2260586dc18bf2b46e5ede488db085da33edf9 (patch) | |
tree | fabb5447e17b9f0959cb83b6d88351367ca53645 /mysql-test/t/distinct.test | |
parent | 6b9a8a92c3d02f9fb66638843de16170e4a0c1a6 (diff) | |
download | mariadb-git-ce2260586dc18bf2b46e5ede488db085da33edf9.tar.gz |
Fixed ALTER TABLE on MERGE tables
Fixed bug in DISTINCT
Diffstat (limited to 'mysql-test/t/distinct.test')
-rw-r--r-- | mysql-test/t/distinct.test | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index 9ddc7ac4a9b..29b2fddbe5f 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -182,3 +182,19 @@ WHERE ((t1.id=j_lj_t2.id AND t2_lj.id IS NULL) OR (t1.id=t2.id AND t2.idx=2)) AND ((t1.id=j_lj_t3.id AND t3_lj.id IS NULL) OR (t1.id=t3.id AND t3.idx=2)); drop table t1,t2,t3; + +# +# Test using DISTINCT on a function that contains a group function +# This also test the case when one doesn't use all fields in GROUP BY. +# + +drop table if exists t1; +create table t1 (a int not null, b int not null, t time); +insert into t1 values (1,1,"00:06:15"),(1,2,"00:06:15"),(1,2,"00:30:15"),(1,3,"00:06:15"),(1,3,"00:30:15"); +select a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b; +select distinct a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b; +create table t2 (a int not null primary key, b int); +insert into t2 values (1,1),(2,2),(3,3); +select t1.a,sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on (t1.b=t2.a) group by t1.a,t2.b; +select distinct t1.a,sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on (t1.b=t2.a) group by t1.a,t2.b; +drop table t1,t2; |