EXPLAIN DELETE for MariaDB
- Backported the code to 10.0-base
- Removed incorrect assert
EXPLAIN DELETE for MariaDB
- Include the testcases in the backport.
SHOW EXPLAIN for MariaDB
- Support [SHOW] EXPLAIN UPDATE (needs code cleanup).
[SHOW] EXPLAIN UPDATE/DELETE - Merge with 10.0-base
SHOW EXPLAIN UPDATE/DELETE: Merge with 10.0-base
SHOW EXPLAIN DELETE, post merge fixes
- Fix asserts, make sure that mysql_delete() operates on 
  thd->apc_target correctly* in all kinds of special cases 
  * - correctly means that one must switch it OFF iff it
  was switched ON.
- Added a few asserts to catch similar errors.
SHOW EXPLAIN UPDATE/DELETE
- Introduce "Query Plan Footprints" (abbrev. QPFs)
  QPF is a part of query plan that is 
  1. sufficient to produce EXPLAIN output,
  2. can be used to produce EXPLAIN output even after its subquery/union
     was executed and deleted
  3. is cheap to save so that we can always save query plans

- This patch doesn't fully address #2, we make/save strings for 
  a number of EXPLAIN's columns.  This will be fixed.
[SHOW] EXPLAIN UPDATE/DELETE, code reordering
- Add further details, the goal is to pass the testsuite
- SJM-nests are not printed correctly yet.
[SHOW] EXPLAIN UPDATE/DELETE, code re-architecting
- Fix more problems to pass the testsuite (not finished yet)
[SHOW] EXPLAIN UPDATE/DELETE, code re-architecting
- Pass more tests
- select with subselects is now shown with type=PRIMARY where it used to be (incorrectly) 'SIMPLE'
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
Part 2 of:
- Pass more tests
- select with subselects is now shown with type=PRIMARY where it used to be (incorrectly) 'SIMPLE'
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Make EXPLAIN UPDATE/DELETE use "Query Plan Footprints", too.
Fixed comments
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Introduce back QueryPlan/QueryPlanFootprint separation for 
  single-table UPDATEs/DELETEs
- Create an empty QueryPlanFootprint for all kinds of queries
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
Single table UPDATE/DELETE
- Correctly print type=SIMPLE vs type=PRIMARY
- Handle UPDATE/DELETE of mergeable VIEWs: we get the 
  VIEW's select as the first subquery. 
  (MySQL 5.6 doesn't print it because it finds that the
   subquery is not attached to any select)
Switching [EXPLAIN] UPDATE/DELETE to rely on query plan footprints.
This requires that subselect's footprints are saved before it is deleted.

Attempt to save select's QPF exposes one to a variety of edge cases:
- the select may be a UNION's "fake select" which has no valid id
- optimization may fail in the middle (but subsequent JOIN::optimize() calls
  will succeed, despite the fact that there never was a query plan)
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Handle statements inside SPs:
  = regular statements
  = SET command, which does not have its own statement.

- Handle execution of subquery from range optimizer: 
  allocate subquery QPFs on the same MEM_ROOT as the whole 
  query plan was allocated.
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Handle another specific case where there the JOIN 
  never had a query plan, but had multiple join->cleanup(full=true) calls
- The idea that there can only be MAX_TABLES subuqeries/unions was 
  wrong. Switch QPF_query to using a Dynamic_array.
  = make Dynamic_array template support size growth. its underlying
    DYNAMIC_ARRAY supports it. (this part will need more polishing)
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Support "using index for group-by (scanning) " queries
MDEV-4506: Parallel replication of group-committed transactions: Intermediate commit

First very rough sketch. We spawn and retire a pool of slave threads.
Test main.alias works, most likely not much else does.