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

MDEV-24583 SELECT aborts after failed REPLACE into table with vcol

table->move_fields wasn't undone in case of error.

1. move_fields is unconditionally undone even when error is occurred
2. cherry-pick an assertion in `ptr_in_record`, which is already in 10.5
This commit is contained in:
Nikita Malyavin
2021-03-24 01:02:26 +03:00
parent f85afa5124
commit 43e879c717
6 changed files with 191 additions and 4 deletions

View File

@ -1753,9 +1753,10 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
in handler methods for the just read row in record[1].
*/
table->move_fields(table->field, table->record[1], table->record[0]);
if (table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_REPLACE))
goto err;
int verr = table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_REPLACE);
table->move_fields(table->field, table->record[0], table->record[1]);
if (verr)
goto err;
}
if (info->handle_duplicates == DUP_UPDATE)
{