summaryrefslogtreecommitdiff
path: root/mysql-test/t/explain_json.test
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2014-12-06 19:27:42 +0300
committerSergei Petrunia <psergey@askmonty.org>2014-12-06 19:27:42 +0300
commitdc259324d767e10f118c2d14dc905e1bb54aa58a (patch)
tree05457081ff73b28034d7b5088a2c56e9e67730f3 /mysql-test/t/explain_json.test
parent5ee1c25fa8043f81ad744d1c532b8c1dafa3b5ea (diff)
downloadmariadb-git-dc259324d767e10f118c2d14dc905e1bb54aa58a.tar.gz
EXPLAIN JSON: Print out the "expensive constant condition" attached to joins.
Diffstat (limited to 'mysql-test/t/explain_json.test')
-rw-r--r--mysql-test/t/explain_json.test20
1 files changed, 19 insertions, 1 deletions
diff --git a/mysql-test/t/explain_json.test b/mysql-test/t/explain_json.test
index 476cb0d3df6..602d1c06f16 100644
--- a/mysql-test/t/explain_json.test
+++ b/mysql-test/t/explain_json.test
@@ -2,7 +2,7 @@
# EXPLAIN FORMAT=JSON tests. These are tests developed for MariaDB.
#
--disable_warnings
-drop table if exists t0,t1;
+drop table if exists t0,t1,t2;
--enable_warnings
create table t0(a int);
@@ -167,3 +167,21 @@ EXPLAIN FORMAT=JSON SELECT * FROM t1 AS outer_t1 WHERE a <> ALL ( SELECT a FROM
DROP TABLE t1,t2;
+--echo #
+--echo # Join's constant expression
+--echo #
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1(a int, b int);
+insert into t1 select tbl1.a+10*tbl2.a, 1234 from t0 tbl1, t0 tbl2;
+
+explain format=json
+select * from t0
+where
+ 20000 > all (select max(tbl1.a + tbl2.a)
+ from t1 tbl1, t1 tbl2 where tbl1.b=tbl2.b);
+
+drop table t1;
+drop table t0;
+