summaryrefslogtreecommitdiff
path: root/mysql-test/t/explain_json.test
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2014-11-27 19:32:48 +0300
committerSergei Petrunia <psergey@askmonty.org>2014-11-27 19:32:48 +0300
commit37c444e1a079b25d0a34efbbc2fadfae17999966 (patch)
tree9f6a6cb52ad06d5fd7caf23bd401414421432caa /mysql-test/t/explain_json.test
parent3d5f97fd708e12201636179baee2c8bc0093c109 (diff)
downloadmariadb-git-37c444e1a079b25d0a34efbbc2fadfae17999966.tar.gz
EXPLAIN FORMAT=JSON: further development
Writing JSON: - Fix a bug in Single_line_formatting_helper - Add Json_writer_nesting_guard - safety class EXPLAIN JSON support - Add basic subquery support - Add tests for UNION/UNION ALL.
Diffstat (limited to 'mysql-test/t/explain_json.test')
-rw-r--r--mysql-test/t/explain_json.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/explain_json.test b/mysql-test/t/explain_json.test
index 0b7bfb030d9..32932e0ff69 100644
--- a/mysql-test/t/explain_json.test
+++ b/mysql-test/t/explain_json.test
@@ -39,4 +39,24 @@ explain format=json select * from t2 where a1=1 or (b1=2 and b2=3);
explain format=json select * from t0,t2 where t2.b1=t0.a and t2.b2=4;
drop table t1,t2;
+
+--echo #
+--echo # Try a UNION
+--echo #
+explain format=json select * from t0 A union select * from t0 B;
+explain format=json select * from t0 A union all select * from t0 B;
+
+--echo #
+--echo # Subqueries
+--echo #
+create table t1 (a int, b int);
+insert into t1 select a,a from t0;
+explain format=json select a, a > (select max(b) from t1 where t1.b=t0.a) from t0;
+
+explain format=json
+select * from t0 where
+ a > (select max(b) from t1 where t1.b=t0.a) or a < 3 ;
+
+drop table t1;
drop table t0;
+