Commit fc292f42 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-29199 Unique hash key is ignored upon INSERT ... SELECT into non-empty MyISAM table

disable bulk insert optimization if long uniques are used, because they
need to read the table (index_read) after every inserted now. And bulk
insert optimization might disable indexes.

bulk insert is already disabled in other cases when there are chances
that the table will be read duing the bulk insert.
parent db50919f
This diff is collapsed.
This diff is collapsed.
...@@ -3846,7 +3846,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u) ...@@ -3846,7 +3846,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
lex->current_select->join->select_options|= OPTION_BUFFER_RESULT; lex->current_select->join->select_options|= OPTION_BUFFER_RESULT;
} }
else if (!(lex->current_select->options & OPTION_BUFFER_RESULT) && else if (!(lex->current_select->options & OPTION_BUFFER_RESULT) &&
thd->locked_tables_mode <= LTM_LOCK_TABLES) thd->locked_tables_mode <= LTM_LOCK_TABLES &&
!table->s->long_unique_table)
{ {
/* /*
We must not yet prepare the result table if it is the same as one of the We must not yet prepare the result table if it is the same as one of the
......
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