diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2015-10-06 13:52:27 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2015-10-06 13:52:27 +0300 |
commit | a7dd24cdaa739727f06a44a5386af092f17c10e3 (patch) | |
tree | 63b45725d8903a76acfbd161a39f5b34aff51bd0 /mysql-test/r | |
parent | bb22eb55dba5ebe41af2f554e74520d66bbbcf26 (diff) | |
download | mariadb-git-a7dd24cdaa739727f06a44a5386af092f17c10e3.tar.gz |
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().
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/explain_non_select.result | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/explain_non_select.result b/mysql-test/r/explain_non_select.result index 0eee7ee9b1e..8e336a0f8c0 100644 --- a/mysql-test/r/explain_non_select.result +++ b/mysql-test/r/explain_non_select.result @@ -232,3 +232,18 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE user index NULL PRIMARY 420 NULL 4 Using index DROP TABLE t1; DROP VIEW v1; +# +# MDEV-8299: MyISAM or Aria table gets corrupted after EXPLAIN INSERT and INSERT +# +CREATE TABLE t1 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, i INT, KEY(i)) ENGINE=MyISAM; +INSERT INTO t1 (i) VALUES (100),(200); +CREATE TABLE t2 (j INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (10),(20); +EXPLAIN INSERT INTO t1 (i) SELECT j FROM t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +INSERT INTO t1 (i) VALUES (300); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1, t2; |