summaryrefslogtreecommitdiff
path: root/mysql-test/main/distinct.result
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2023-04-14 11:32:36 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2023-04-14 11:32:36 +0300
commit44281b88f3ce04e85ba49ba1f557f6cca328a4e7 (patch)
tree4daba52cd11f3b52e96af3e0887eee7bc7d4e034 /mysql-test/main/distinct.result
parent55e78ebf4136ed7bf78b45963f53e503201a59bb (diff)
parent10147af9e5b25739bada32c6eb4f204d5f2985a1 (diff)
downloadmariadb-git-44281b88f3ce04e85ba49ba1f557f6cca328a4e7.tar.gz
Merge 10.8 into 10.9
Diffstat (limited to 'mysql-test/main/distinct.result')
-rw-r--r--mysql-test/main/distinct.result37
1 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/main/distinct.result b/mysql-test/main/distinct.result
index 888d3143f2c..0c5eccad754 100644
--- a/mysql-test/main/distinct.result
+++ b/mysql-test/main/distinct.result
@@ -1071,6 +1071,43 @@ UNION
drop table t1;
End of 5.5 tests
#
+# MDEV-20057 Distinct SUM on CROSS JOIN and grouped returns wrong result
+#
+create table t1 (c int, d int);
+insert into t1 values (5, 1), (0, 3);
+select distinct sum(distinct 1), sum(t1.d) > 2 from (t1 e join t1) group by t1.c;
+sum(distinct 1) sum(t1.d) > 2
+1 1
+1 0
+select distinct sum(distinct 1), sum(t1.d) > 2, t1.c from (t1 e join t1) group by t1.c;
+sum(distinct 1) sum(t1.d) > 2 c
+1 1 0
+1 0 5
+insert into t1 values (6,6);
+select distinct sum(distinct 1), sum(t1.d) > 5 from (t1 e join t1) group by t1.c;
+sum(distinct 1) sum(t1.d) > 5
+1 1
+1 0
+select distinct sum(distinct 1), sum(t1.d) > 5, t1.c from (t1 e join t1) group by t1.c;
+sum(distinct 1) sum(t1.d) > 5 c
+1 1 0
+1 0 5
+1 1 6
+set @@sort_buffer_size=1024;
+insert into t1 select -seq,-seq from seq_1_to_100;
+select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000 from (t1 e join t1) group by t1.c having t1.c > -2 ;
+sum(distinct 1) sum(t1.d) > 2 length(group_concat(t1.d)) > 1000
+1 0 0
+1 1 0
+select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000,t1.c from (t1 e join t1) group by t1.c having t1.c > -2;
+sum(distinct 1) sum(t1.d) > 2 length(group_concat(t1.d)) > 1000 c
+1 0 0 -1
+1 1 0 0
+1 1 0 5
+1 1 0 6
+drop table t1;
+# End of 10.4 tests
+#
# MDEV-27382: OFFSET is ignored when it is combined with the DISTINCT, IN() and JOIN
#
CREATE TABLE t1 (