MDEV-6109: EXPLAIN JSON
- First code, "EXPLAIN FORMAT=JSON stmt" and "ANALYZE FORMAT=JSON stmt"
  work for basic queries.  Complex constructs (e.g subqueries, etc) not
  yet supported.
- No test infrastructure yet
Merge 10.1 (with ANALYZE) and 10.1-explain-json
MDEV-6109: EXPLAIN JSON

- Add first testcases
- Don't overquote when printing conditions
- Other small output fixes
MDEV-6109: EXPLAIN JSON

Add pretty-printing of possible_keys column.
EXPLAIN FORMAT=JSON: produce the 'ref' column.
EXPLAIN FORMAT=JSON: produce used_key_parts, JSON-ish output for index_merge.
Merge ../10.1 into bb-10.1-explain-json
Better comments
Better comments
Make testsuite to pass

- Drop all tables in explain_json.test
- Tabular form should print ref='' when type='fulltext' (another peculiarity
  of the traditional EXPLAIN format)
- String_list::append_str should allocate memory for \0, too
- Some temporary code for EXPLAIN JSON and join buffering.
Merge ../10.1-explain-json-r4 into 10.1
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.
EXPLAIN FORMAT=JSON: support join buffering

- Basic support for JOIN buffering
- The output is not polished but catches the main point:
  tab->select_cond and tab->cache_select->cond are printed separately.
- Hash join support is poor still.

- Also fixed identation in JOIN_TAB::save_explain_data
EXPLAIN FORMAT=JSON: Add support for single-table UPDATE/DELETE.
Make explain_json.test pass on case-insensitive FS.
EXPLAIN FORMAT=JSON: support derived tables
EXPLAIN FORMAT=JSON: Add support for non-merged semi-joins
ANALYZE FORMAT=JSON: better output and tests

- Print r_loops
- Always print r_* members. Print NULL values if no scans took place
- Added testcases.
EXPLAIN FORMAT=JSON: support EXPLAIN FORMAT=JSON INSERT ...
EXPLAIN FORMAT=JSON: support SJ-Materialization

- Switch Explain data structure from "flat" representation of
  SJ-Materialization into nested one.
- Update functions that print tabular output to operate on the
  nested structure.
- Add function to generate JSON output.