diff options
author | serg@sergbook.mysql.com <> | 2003-02-10 12:01:47 +0100 |
---|---|---|
committer | serg@sergbook.mysql.com <> | 2003-02-10 12:01:47 +0100 |
commit | cba78f827c0906c8275820897dd676945bdd0971 (patch) | |
tree | 6eed7ec5d21e357462e4f4346568d6c2c68654eb /mysql-test | |
parent | c0b655aa387a2d61a3c6507a9f9bca1f7febab03 (diff) | |
download | mariadb-git-cba78f827c0906c8275820897dd676945bdd0971.tar.gz |
count(distint) on an empty table crash fixed
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/count_distinct.result | 5 | ||||
-rw-r--r-- | mysql-test/t/count_distinct.test | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/r/count_distinct.result b/mysql-test/r/count_distinct.result index 81976d268ef..16460580d6c 100644 --- a/mysql-test/r/count_distinct.result +++ b/mysql-test/r/count_distinct.result @@ -48,3 +48,8 @@ select t1.f1,count(distinct t2.f2),count(distinct 1,NULL) from t1 left join t2 o f1 count(distinct t2.f2) count(distinct 1,NULL) 1 0 0 drop table t1,t2; +create table t1 (f int); +select count(distinct f) from t1; +count(distinct f) +0 +drop table t1; diff --git a/mysql-test/t/count_distinct.test b/mysql-test/t/count_distinct.test index f3584686f69..cb84d0211d7 100644 --- a/mysql-test/t/count_distinct.test +++ b/mysql-test/t/count_distinct.test @@ -43,3 +43,12 @@ insert into t1 values (1); create table t2 (f1 int,f2 int); select t1.f1,count(distinct t2.f2),count(distinct 1,NULL) from t1 left join t2 on t1.f1=t2.f1 group by t1.f1; drop table t1,t2; + + +# +# Empty tables +# +create table t1 (f int); +select count(distinct f) from t1; +drop table t1; + |