From da3ec3d421c345bbd4b6ddfe0e1e08ed192c0a97 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 9 Sep 2015 16:29:50 +0200 Subject: MDEV-7970: EXPLAIN FORMAT=JSON does not print HAVING Printing non-trivial HAVING added. --- mysql-test/t/explain_json.test | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'mysql-test/t/explain_json.test') diff --git a/mysql-test/t/explain_json.test b/mysql-test/t/explain_json.test index 1078222725e..4279d3b4fb4 100644 --- a/mysql-test/t/explain_json.test +++ b/mysql-test/t/explain_json.test @@ -278,7 +278,6 @@ explain format=json select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') a drop table t1; - --echo # --echo # MDEV-8786 Wrong result for SELECT FORMAT=JSON * FROM t1 WHERE a=_latin1 0xDF --echo # @@ -294,3 +293,26 @@ CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1); INSERT INTO t1 VALUES ('a'),('A'); EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE NULLIF(a,_utf8'a' COLLATE utf8_bin); DROP TABLE t1; + +--echo # +--echo # MDEV-7970: EXPLAIN FORMAT=JSON does not print HAVING +--echo # +create table t0(a int); +insert into t0 values (0),(1),(2),(3); +create table t1(a int); +insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C; +create table t2 ( + a int, + b int, + key (a) +); +insert into t2 select A.a*1000 + B.a, A.a*1000 + B.a from t0 A, t1 B; +--echo # normal HAVING +explain format=json select a, max(b) as TOP from t2 group by a having TOP > a; +--echo # HAVING is always TRUE (not printed) +explain format=json select a, max(b) as TOP from t2 group by a having 1<>2; +--echo # HAVING is always FALSE (intercepted by message) +explain format=json select a, max(b) as TOP from t2 group by a having 1=2; +--echo # HAVING is absent +explain format=json select a, max(b) as TOP from t2 group by a; +drop table t0, t1, t2; -- cgit v1.2.1