From 5257d71e0e495216162b790efc6866027aa2b718 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 15 Dec 2014 17:13:47 +0200 Subject: 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 --- mysql-test/r/group_by.result | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mysql-test/r/group_by.result') diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 57f21a5e0eb..32f7d61319b 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -2493,3 +2493,17 @@ SELECT i2 FROM t1 AS t1a STRAIGHT_JOIN ( t2 INNER JOIN t1 AS t1b ON (t1b.c1 = c2 WHERE t1a.c1 = c2 GROUP BY i2; i2 DROP TABLE t1,t2; +# +# MDEV-6855 +# MIN(*) with subqueries with IS NOT NULL in WHERE clause crashed. +# +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; +MAX(i) c +0 bar +7 foo +drop table t1,t2; -- cgit v1.2.1