1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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.
This commit is contained in:
Sergei Petrunia
2014-11-27 19:32:48 +03:00
parent 3d5f97fd70
commit 37c444e1a0
9 changed files with 298 additions and 14 deletions

View File

@@ -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;