mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge sunlight.local:/local_work/27216-bug-5.0-opt-mysql
into sunlight.local:/local_work/merge-5.1-opt-mysql
This commit is contained in:
@ -2778,7 +2778,8 @@ select_insert::select_insert(TABLE_LIST *table_list_par, TABLE *table_par,
|
||||
bool ignore_check_option_errors)
|
||||
:table_list(table_list_par), table(table_par), fields(fields_par),
|
||||
autoinc_value_of_last_inserted_row(0),
|
||||
insert_into_view(table_list_par && table_list_par->view != 0)
|
||||
insert_into_view(table_list_par && table_list_par->view != 0),
|
||||
is_bulk_insert_mode(FALSE)
|
||||
{
|
||||
bzero((char*) &info,sizeof(info));
|
||||
info.handle_duplicates= duplic;
|
||||
@ -2964,8 +2965,11 @@ int select_insert::prepare2(void)
|
||||
{
|
||||
DBUG_ENTER("select_insert::prepare2");
|
||||
if (thd->lex->current_select->options & OPTION_BUFFER_RESULT &&
|
||||
!thd->prelocked_mode)
|
||||
!thd->prelocked_mode && !is_bulk_insert_mode)
|
||||
{
|
||||
table->file->ha_start_bulk_insert((ha_rows) 0);
|
||||
is_bulk_insert_mode= TRUE;
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@ -3084,6 +3088,7 @@ bool select_insert::send_eof()
|
||||
trans_table, table->file->table_type()));
|
||||
|
||||
error= (!thd->prelocked_mode) ? table->file->ha_end_bulk_insert():0;
|
||||
is_bulk_insert_mode= FALSE;
|
||||
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
|
||||
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
|
||||
|
||||
@ -3307,7 +3312,10 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
|
||||
Create_field *cr_field;
|
||||
Field *field, *def_field;
|
||||
if (item->type() == Item::FUNC_ITEM)
|
||||
field= item->tmp_table_field(&tmp_table);
|
||||
if (item->result_type() != STRING_RESULT)
|
||||
field= item->tmp_table_field(&tmp_table);
|
||||
else
|
||||
field= item->tmp_table_field_from_field_type(&tmp_table);
|
||||
else
|
||||
field= create_tmp_field(thd, &tmp_table, item, item->type(),
|
||||
(Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0,
|
||||
@ -3518,7 +3526,10 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
|
||||
if (info.handle_duplicates == DUP_UPDATE)
|
||||
table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
|
||||
if (!thd->prelocked_mode)
|
||||
{
|
||||
table->file->ha_start_bulk_insert((ha_rows) 0);
|
||||
is_bulk_insert_mode= TRUE;
|
||||
}
|
||||
thd->abort_on_warning= (!info.ignore &&
|
||||
(thd->variables.sql_mode &
|
||||
(MODE_STRICT_TRANS_TABLES |
|
||||
|
Reference in New Issue
Block a user