summaryrefslogtreecommitdiff
path: root/mysql-test/t/group_by.test
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2014-12-15 17:13:47 +0200
committerMichael Widenius <monty@mariadb.org>2014-12-15 17:13:47 +0200
commit5257d71e0e495216162b790efc6866027aa2b718 (patch)
tree81ea5bb5e6f457debf1d97f26e3ac45732b7bc1d /mysql-test/t/group_by.test
parent10ab3e68876bc7a16a6a2108a445f38778fa3df4 (diff)
downloadmariadb-git-5257d71e0e495216162b790efc6866027aa2b718.tar.gz
MDEV-6855 Assertion `cond_type == Item::FUNC_ITEM' failed in check_group_min_max_predicates with GROUP BY, aggregate in WHERE SQ, multi-part key
mysql-test/r/group_by.result: Test for MDEV-6855 mysql-test/t/group_by.test: Test for MDEV-6855 sql/item.h: Fixed spelling error sql/opt_range.cc: Added handling of cond_type == Item::CACHE_ITEM in WHERE clauses for MIN/MAX optimization. Fixed indentation
Diffstat (limited to 'mysql-test/t/group_by.test')
-rw-r--r--mysql-test/t/group_by.test15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 92d1c18ee13..a1f7f693c21 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1665,6 +1665,21 @@ WHERE t1a.c1 = c2 GROUP BY i2;
DROP TABLE t1,t2;
+--echo #
+--echo # MDEV-6855
+--echo # MIN(*) with subqueries with IS NOT NULL in WHERE clause crashed.
+--echo #
+
+CREATE TABLE t1 (i INT, c VARCHAR(3), KEY(c,i)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7,'foo'),(0,'bar');
+
+CREATE TABLE t2 (j INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (0),(8),(1),(8),(9);
+
+SELECT MAX(i), c FROM t1
+WHERE c != 'qux' AND ( SELECT SUM(j) FROM t1, t2 ) IS NOT NULL GROUP BY c;
+drop table t1,t2;
+
#
# End of MariaDB 5.5 tests
#