From 328684833b3e6e8fad5a71a4c6aa1676cb6c6e37 Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Tue, 11 Jan 2022 20:25:11 +0300 Subject: MDEV-10000 Add EXPLAIN [FORMAT=JSON] FOR CONNECTION syntax support EXPLAIN FOR CONNECTION is a MySQL-compatible syntax for SHOW EXPLAIN. This commit also adds support for FORMAT=JSON to SHOW EXPLAIN, so the possible options to get JSON-formatted output are: - SHOW EXPLAIN FORMAT=JSON FOR $con - EXPLAIN FORMAT=JSON FOR CONNECTION $con --- sql/sql_show.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sql/sql_show.h') diff --git a/sql/sql_show.h b/sql/sql_show.h index 3d7a4d1146c..ccdfca50ac2 100644 --- a/sql/sql_show.h +++ b/sql/sql_show.h @@ -164,6 +164,12 @@ public: THD *target_thd; /* thd that we're running SHOW EXPLAIN for */ THD *request_thd; /* thd that run SHOW EXPLAIN command */ + /* + Set to TRUE if you need the result in JSON format, + FALSE - in traditional tabular + */ + bool is_json_format= false; + /* If true, there was some error when producing EXPLAIN output. */ bool failed_to_produce; -- cgit v1.2.1