Commit 672b61c5 authored by unknown's avatar unknown

Changed test case for bug 22342 to make it platform independent.

parent b18b419b
...@@ -2143,10 +2143,10 @@ id2 id3 id5 id4 id3 id6 id5 id1 ...@@ -2143,10 +2143,10 @@ id2 id3 id5 id4 id3 id6 id5 id1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
DROP TABLE t1,t2,t3,t4,t5,t6; DROP TABLE t1,t2,t3,t4,t5,t6;
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b), KEY b (b)); 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; 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 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; SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
MAX(b) a MAX(b) a
1 1 1 1
...@@ -2157,7 +2157,7 @@ CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a,b,c)); ...@@ -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; 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; 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 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; SELECT MIN(c) FROM t2 WHERE b = 2 and a = 1 and c > 1 GROUP BY a;
MIN(c) MIN(c)
2 2
......
...@@ -799,7 +799,7 @@ DROP TABLE t1,t2,t3,t4,t5,t6; ...@@ -799,7 +799,7 @@ DROP TABLE t1,t2,t3,t4,t5,t6;
# Bug#22342: No results returned for query using max and group by # 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)); 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; 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; SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment