Re-commit in git:
MDEV-406: ANALYZE $stmt
- Ported the old patch to new explain code
- New SQL syntax (ANALYZE $stmt)
- ANALYZE UPDATE/DELETE is now supported (because EXPLAIN UPDATE/DELETE is supported)
- Basic counters are calculated for basic kinds of queries
  (still need to see what happens with join buffer, ORDER BY...LIMIT queries, etc)
MDEV-406: ANALYZE $stmt
-Add analyze_stmt.test/result
MDEV-406: ANALYZE $stmt
- Support tracking for UNIONs, temporary-table based ORDER BYs,
  and both.
MDEV-406: ANALYZE $stmt
- Testcase for ANALYZE UNION
- Provide r_rows for union result.
Update analyze_stmt.result after the last commit
MDEV-406: ANALYZE $stmt: get ANALYZE work for subqueries

- "ANALYZE $stmt" should discard select's output, but it should still
  evaluate the output columns (otherwise, subqueries in select list
  are not executed)
- SHOW EXPLAIN's code practice of calling JOIN::save_explain_data()
  after JOIN::exec() is disastrous for ANALYZE, because it resets
  all counters after the first execution. It is stopped
  = "Late" test_if_skip_sort_order() calls explicitly update their part
    of the query plan.
  = Also, I had to rewrite I_S optimization to actually have optimization
    and execution stages.
MDEV-406: ANALYZE $stmt: fix order_by.test

In JOIN_TAB::update_explain_data(), take into account that
- the table that may have pre-sorted is the first non-const table
- Tables that are eliminated by table elimination are marked
  as const tables, but are not present in the Explain data structures
Fix compile on Windows: use rint() instead of round().
MDEV-406: ANALYZE $stmt: Scans that never executed will have r_rows=NULL
MDEV-406: ANALYZE $stmt: add support for BNL join buffering
MDEV-406: ANALYZE $stmt: add some tests for joins
Merge bb-10.1-explain-analyze into 10.1
MDEV-406: ANALYZE $stmt: more testcases, fix memory leak
MDEV-406: ANALYZE $stmt: fix "explain UPDATE view problem".
MDEV-406: ANALYZE $stmt: Make multi-table UPDATE/DELETE work, code cleanup.
Code cleanup
Merge branch 'bb-10.1-explain-analyze' into 10.1