diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2017-06-20 14:55:30 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2017-06-23 09:16:27 +0200 |
commit | b76b69cd5fe634d8ddb9406aa2c82ef2a375b4d8 (patch) | |
tree | 6fcfaab8b2065a93d40cc84407ef4f7c347f2bff /mysql-test/t/order_by.test | |
parent | f65d6a03f0870fbac0ce99bc948b28963e594ff3 (diff) | |
download | mariadb-git-b76b69cd5fe634d8ddb9406aa2c82ef2a375b4d8.tar.gz |
MDEV-10880: Assertions `keypart_map' or `prebuilt->search_tuple->n_fields > 0' fail on DISTINCT and GROUP BY constant
add_group_and_distinct_keys() should take into account JOIN::simple_group.
Diffstat (limited to 'mysql-test/t/order_by.test')
-rw-r--r-- | mysql-test/t/order_by.test | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 2d0c134a2d9..f61a6a8be34 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -2091,3 +2091,15 @@ set @@optimizer_switch=@tmp_8989; set optimizer_switch='orderby_uses_equalities=on'; + +--echo # +--echo # MDEV-10880: Assertions `keypart_map' or +--echo # `prebuilt->search_tuple->n_fields > 0' fail on DISTINCT and +--echo # GROUP BY constant +--echo # + +CREATE TABLE t1 (pk INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2),(3); +SELECT DISTINCT pk FROM t1 GROUP BY 'foo'; +SELECT DISTINCT pk FROM t1; +DROP TABLE t1; |