diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-01-26 22:33:18 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-01-26 22:33:18 +0100 |
commit | 0791692bdc311f39181b9df236981a2cb439638e (patch) | |
tree | 257434af8644ac23574ef59534e5e2f596b146be /mysql-test/r | |
parent | 298008dc4fbf4c5cc98d86115218bf89611ff7ea (diff) | |
download | mariadb-git-0791692bdc311f39181b9df236981a2cb439638e.tar.gz |
MDEV-3875 Wrong result (missing row) on a DISTINCT query with the same subquery in the SELECT list and GROUP BY
fix remove_dup_with_hash_index() and remove_dup_with_compare() to take NULLs into account
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/distinct.result | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 99d98d2a9bc..dc3b2fb1b47 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -847,3 +847,35 @@ time(f1) 00:00:00.000200 00:00:00.000300 drop table t1; +create table t1(i int, g int); +insert into t1 values (null, 1), (0, 2); +select distinct i from t1 group by g; +i +NULL +0 +drop table t1; +create table t1(i int, g blob); +insert into t1 values (null, 1), (0, 2); +select distinct i from t1 group by g; +i +NULL +0 +drop table t1; +create table t1 (a int) engine=myisam; +insert into t1 values (0),(7); +create table t2 (b int) engine=myisam; +insert into t2 values (7),(0),(3); +create algorithm=temptable view v as +select distinct (select max(a) from t1 where alias.b = a) as field1 from t2 as alias group by field1; +select * from v; +field1 +NULL +0 +7 +select distinct (select max(a) from t1 where alias.b = a) as field1 from t2 as alias group by field1; +field1 +NULL +0 +7 +drop view v; +drop table t1, t2; |