Hi!
On Nov 01, eugene@stripped wrote:
> ChangeSet@stripped, 2007-11-01 00:26:10+00:00, evgen@stripped +2 -0
> Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
> led to creating corrupted index.
>
> Corrected fix. The call to the handler::start_bulk_insert function was
> removed from the select_insert::prepare2 function because of its redundancy.
> The is_bulk_insert_mode flag is removed as it is not needed anymore.
>
> diff -Nrup a/sql/sql_class.h b/sql/sql_class.h
> --- a/sql/sql_class.h 2007-09-21 08:06:30 +00:00
> +++ b/sql/sql_class.h 2007-11-01 00:25:17 +00:00
> diff -Nrup a/sql/sql_insert.cc b/sql/sql_insert.cc
> --- a/sql/sql_insert.cc 2007-09-27 09:17:13 +00:00
> +++ b/sql/sql_insert.cc 2007-11-01 00:22:38 +00:00
> @@ -2830,12 +2829,6 @@ select_insert::prepare(List<Item> &value
> int select_insert::prepare2(void)
> {
> DBUG_ENTER("select_insert::prepare2");
> - if (thd->lex->current_select->options & OPTION_BUFFER_RESULT
> &&
> - !thd->prelocked_mode && !is_bulk_insert_mode)
> - {
> - table->file->start_bulk_insert((ha_rows) 0);
> - }
> DBUG_RETURN(0);
> }
No. Did you understand why Ingo moved start_bulk_insert() here ?
By removing this code you've disabled bulk insert optimization for
INSERT table SELECT ... FROM table
Regards / Mit vielen Grüssen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Developer
/_/ /_/\_, /___/\___\_\___/ MySQL GmbH, Dachauer Str. 37, D-80335 München
<___/ Geschäftsführer: Kaj Arnö - HRB
München 162140