Commit graph

15 commits

Author SHA1 Message Date
Michael Widenius
a7abddeffa Create 'main' test directory and move 't' and 'r' there 2018-03-29 13:59:44 +03:00
Sergei Petrunia
1289794799 Fix for MDEV-8321, MDEV-6223
EXPLAIN INSERT ... SELECT tried to use SELECT's execution path. This
caused a collection of problems:
- SELECT_DESCRIBE flag was not put into select_lex->options, which
  means it was not in JOIN::select_options either (except for the first
  member of the UNION).
- This caused UNION members to be executed. They would attempt to write
  join output rows to the output.
- (Actual cause of the crash) second join sibling would call
  result->send_eof() when finished execution. Then,
  Explain_query::print_explain would attempt to write to query output
  again, and cause an assertion due to non-empty query output.
2015-10-06 15:54:37 +03:00
Sergei Petrunia
a7dd24cdaa MDEV-8299: MyISAM or Aria table gets corrupted after EXPLAIN INSERT and INSERT
[EXPLAIN] INSERT .. SELECT creates a select_insert object.
select_insert calls handler->start_bulk_insert() during
initialization.

For MyISAM/Aria this requires that a matching call to
handler->end_bulk_insert() call is made.

Regular INSERT .. SELECT accomplishes this by calling either
select_result->send_eof() or select_result->abort_result_set().

EXPLAIN INSERT ... SELECT didn't call either, which resulted in
improper de-initializaiton of handler object. Make it call
abort_result_set(), which invokes handler->end_bulk_insert().
2015-10-06 13:52:27 +03:00
Vicențiu Ciorbaru
acab0faa14 MDEV-7038 Assertion `status_var.memory_used == 0' failed in THD::~THD() on disconnect after executing EXPLAIN for multi-table UPDATE
Added test case that caught this bug. It is no longer reproducible in
the current tree.
2015-05-02 21:46:32 +03:00
Sergey Petrunya
3e8f7c8516 MDEV-5122: "Commands out of sync", "Malformed packet" or client hang up...
- When INSERT catches an error, it should not attempt to send parts of 
  EXPLAIN output.
2013-10-11 19:27:53 +04:00
Sergey Petrunya
094f70fd19 MDEV-5106: Server crashes in Explain_union::print_explain on ER_TOO_BIG_SELECT
- Don't save UNION's EXPLAIN data if optimization failed with 
  an error. We could end up saving incomplete plan, which will 
  cause a crash when we attempt to print it.
2013-10-10 20:30:32 +04:00
Sergey Petrunya
98a8642fe8 MDEV-3798: EXPLAIN UPDATE/DELETE
- Add support for EXPLAIN INSERT.
2013-10-07 17:29:51 +04:00
Sergey Petrunya
abcf14e595 MDEV-3798: EXPLAIN UPDATE/DELETE
- Handle the case when EXPLAIN UPDATE/DELETE has pruned away all partitions.
2013-10-05 13:44:01 +04:00
Sergey Petrunya
5e4044e92c MDEV-5093, MDEV-5094:
- Make EXPLAIN {PARTITIONS,EXTENDED} {UPDATE,DELETE} work.
2013-10-04 18:50:47 +04:00
Sergey Petrunya
0b69c44e94 MDEV-5067: Valgrind warnings (Invalid read) in QPF_table_access::print_explain
- Query plan footprint (in new terms, "EXPLAIN structure") should always keep 
  a copy of key_name.  This is because the table might be a temporary table which
  may be already freed by the time we use query plan footprint.
2013-09-26 14:42:30 +04:00
Sergey Petrunya
ac54df04d8 MDEV-5070 - EXPLAIN INSERT ... SELECT crashes on 10.0-base-explain-slowquerylog
- Add EXPLAIN output print out for INSERT/REPLACE ... SELECT
2013-09-25 17:23:22 +04:00
Sergey Petrunya
eeb6713257 [SHOW] EXPLAIN UPDATE/DELETE
- Post-merge fixes (conflict with DELETE .. RETURNING)
- Add a testcase with EXPLAIN ... DELETE ... RETURNING
2013-08-26 14:43:52 +04:00
Sergey Petrunya
1c6fc3f6b9 [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'
2013-06-18 19:21:00 +04:00
Sergey Petrunya
d2995031d9 SHOW EXPLAIN for MariaDB
- Support [SHOW] EXPLAIN UPDATE (needs code cleanup).
2013-02-12 14:37:08 +04:00
Sergey Petrunya
b38b44cfe1 EXPLAIN DELETE for MariaDB
- Include the testcases in the backport.
2013-02-12 08:24:48 +04:00