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

MDEV-26693 ROW_NUMBER is wrong upon INSERT or UPDATE on Spider table

in case of a bulk insert the server sends all rows to the engine, and
then the engine replies that there was ER_DUP_ENTRY somewhere.

the exact number of the row that caused the error is unknown.
This commit is contained in:
Sergei Golubchik
2021-10-07 18:19:56 +02:00
parent 9bbd328254
commit 5c0b63458b
3 changed files with 89 additions and 2 deletions

View File

@ -1158,8 +1158,13 @@ values_loop_end:
table->file->ha_release_auto_increment();
if (using_bulk_insert)
{
if (unlikely(table->file->ha_end_bulk_insert()) &&
!error)
/*
if my_error() wasn't called yet on some specific row, end_bulk_insert()
can still do it, but the error shouldn't be for any specific row number
*/
if (!error)
thd->get_stmt_da()->reset_current_row_for_warning(0);
if (unlikely(table->file->ha_end_bulk_insert()) && !error)
{
table->file->print_error(my_errno,MYF(0));
error=1;