summaryrefslogtreecommitdiff
path: root/mysql-test/main/order_by.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-04-25 09:05:52 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-04-25 09:05:52 +0300
commitacf6f92aa936fbfe7524617ae57d011ab8f1f96d (patch)
treee7fc2258c06a0fdab1cce115de4d71a091d82d28 /mysql-test/main/order_by.test
parent765ae6e82165d1bc4cf6cc9f0d556d66a5e172d1 (diff)
parentbc145193c164b895a52b943e73fff53952d48a60 (diff)
downloadmariadb-git-acf6f92aa936fbfe7524617ae57d011ab8f1f96d.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/order_by.test')
-rw-r--r--mysql-test/main/order_by.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test
index b047a31c863..d67c67de89c 100644
--- a/mysql-test/main/order_by.test
+++ b/mysql-test/main/order_by.test
@@ -2187,3 +2187,17 @@ eval explain extended $q;
set optimizer_switch= @save_optimizer_switch;
DROP TABLE books, wings;
+
+--echo #
+--echo # MDEV-17796: query with DISTINCT, GROUP BY and ORDER BY
+--echo #
+
+CREATE TABLE t1 (id int, gr int, v1 varchar(10));
+INSERT INTO t1 VALUES (1,1,'A'), (2,2,'B'), (3,3,NULL), (4,4,'C');
+
+SELECT DISTINCT NULLIF(GROUP_CONCAT(v1), null) FROM t1
+ WHERE gr in (4,2)
+GROUP BY id
+ORDER BY id+1 DESC;
+
+DROP TABLE t1;