diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index 826e642ce88..0304919baf6 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -2143,10 +2143,10 @@ id2 id3 id5 id4 id3 id6 id5 id1 1 1 1 1 1 1 1 1 DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b), KEY b (b)); -INSERT INTO t1 VALUES (1,1),(1,2); +INSERT INTO t1 VALUES (1,1),(1,2),(1,0),(1,3); explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY,b PRIMARY 8 NULL 2 Using where; Using index for group-by +1 SIMPLE t1 range PRIMARY,b PRIMARY 8 NULL 1 Using where; Using index for group-by SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a; MAX(b) a 1 1 @@ -2157,7 +2157,7 @@ CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a,b,c)); INSERT INTO t2 SELECT a,b,b FROM t1; explain SELECT MIN(c) FROM t2 WHERE b = 2 and a = 1 and c > 1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range PRIMARY PRIMARY 12 NULL 2 Using where; Using index for group-by +1 SIMPLE t2 range PRIMARY PRIMARY 12 NULL 1 Using where; Using index for group-by SELECT MIN(c) FROM t2 WHERE b = 2 and a = 1 and c > 1 GROUP BY a; MIN(c) 2 diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test index 9f3fb5ea51e..08f0f54df60 100644 --- a/mysql-test/t/group_min_max.test +++ b/mysql-test/t/group_min_max.test @@ -799,7 +799,7 @@ DROP TABLE t1,t2,t3,t4,t5,t6; # Bug#22342: No results returned for query using max and group by # CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b), KEY b (b)); -INSERT INTO t1 VALUES (1,1),(1,2); +INSERT INTO t1 VALUES (1,1),(1,2),(1,0),(1,3); explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a; SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;