1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-18973 CLIENT_FOUND_ROWS wrong in spider

Get count from last_used_con->info
Contributed by willhan at Tencent Games
This commit is contained in:
Kentoku
2019-11-29 08:22:13 +09:00
parent 3826178da8
commit e066723a41
27 changed files with 846 additions and 43 deletions

View File

@ -904,6 +904,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();
@ -1107,11 +1109,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)
{
@ -1234,8 +1248,12 @@ values_loop_end:
retval= thd->lex->explain->send_explain(thd);
goto abort;
}
if ((iteration * values_list.elements) == 1 && (!(thd->variables.option_bits & OPTION_WARNINGS) ||
!thd->cuted_fields))
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))
{
my_ok(thd, info.copied + info.deleted +
((thd->client_capabilities & CLIENT_FOUND_ROWS) ?