Commit 41208f6e authored by Sergey Petrunya's avatar Sergey Petrunya

MDEV-5426: Assertion `toku_ft_needed_unlocked(src_h)' failed (errno=11) ...

- the problem was caused by EXPLAIN INSERT SELECT. For that statement, 
  the code would call select_insert::prepare2(), which would call 
  handler->ha_start_bulk_insert().  The corresponding handler->end_bulk_insert() 
  call is made from select_insert::send_eof or select_insert::abort_result_set 
  which are never called for EXPLAIN INSERT SELECT.
- Fixed by re-using approach of mysql-5.6: don't call ha_start_bulk_insert() if 
  we are in EXPLAIN.
parent 2ddbe0ec
......@@ -3555,7 +3555,8 @@ int select_insert::prepare2(void)
{
DBUG_ENTER("select_insert::prepare2");
if (thd->lex->current_select->options & OPTION_BUFFER_RESULT &&
thd->locked_tables_mode <= LTM_LOCK_TABLES)
thd->locked_tables_mode <= LTM_LOCK_TABLES &&
!thd->lex->describe)
table->file->ha_start_bulk_insert((ha_rows) 0);
DBUG_RETURN(0);
}
......
CREATE TABLE t1 (i INT) ENGINE=TokuDB;
EXPLAIN INSERT INTO t1 SELECT * FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using temporary
INSERT INTO t1 SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (i INT) ENGINE=TokuDB;
EXPLAIN INSERT INTO t1 SELECT * FROM t1;
--connect con1,localhost,root,,test
INSERT INTO t1 SELECT * FROM t1;
--connection default
--disconnect con1
DROP TABLE t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment