This commit is contained in:
Sergey Petrunya 2014-01-21 14:07:00 +04:00
commit a1a49ec9ed
3 changed files with 18 additions and 1 deletions

View File

@ -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);
}

View File

@ -0,0 +1,6 @@
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;

View File

@ -0,0 +1,10 @@
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;