1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Aleksey Midenkov
2019-12-02 13:35:54 +03:00
47 changed files with 1241 additions and 109 deletions

View File

@ -897,6 +897,8 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
using_bulk_insert= 1;
table->file->ha_start_bulk_insert(values_list.elements);
}
else
table->file->ha_reset_copy_info();
}
thd->abort_on_warning= !ignore && thd->is_strict_mode();
@ -1110,11 +1112,23 @@ values_loop_end:
auto_inc values from the delayed_insert thread as they share TABLE.
*/
table->file->ha_release_auto_increment();
if (using_bulk_insert && unlikely(table->file->ha_end_bulk_insert()) &&
!error)
if (using_bulk_insert)
{
table->file->print_error(my_errno,MYF(0));
error=1;
if (unlikely(table->file->ha_end_bulk_insert()) &&
!error)
{
table->file->print_error(my_errno,MYF(0));
error=1;
}
}
/* Get better status from handler if handler supports it */
if (table->file->copy_info.records)
{
DBUG_ASSERT(info.copied >= table->file->copy_info.copied);
info.touched= table->file->copy_info.touched;
info.copied= table->file->copy_info.copied;
info.deleted= table->file->copy_info.deleted;
info.updated= table->file->copy_info.updated;
}
if (duplic != DUP_ERROR || ignore)
{
@ -1237,9 +1251,12 @@ values_loop_end:
retval= 0;
goto abort;
}
DBUG_PRINT("info", ("touched: %llu copied: %llu updated: %llu deleted: %llu",
(ulonglong) info.touched, (ulonglong) info.copied,
(ulonglong) info.updated, (ulonglong) info.deleted));
if ((iteration * values_list.elements) == 1 && (!(thd->variables.option_bits & OPTION_WARNINGS) ||
!thd->cuted_fields))
if ((iteration * values_list.elements) == 1 &&
(!(thd->variables.option_bits & OPTION_WARNINGS) || !thd->cuted_fields))
{
/*
Client expects an EOF/OK packet if result set metadata was sent. If
@ -1652,6 +1669,8 @@ static int last_uniq_key(TABLE *table,uint keynr)
int vers_insert_history_row(TABLE *table)
{
DBUG_ASSERT(table->versioned(VERS_TIMESTAMP));
if (!table->vers_write)
return 0;
restore_record(table,record[1]);
// Set Sys_end to now()