1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-33470 Unique hash index is broken on DML for system-versioned table

Hash index is vcol-based wrapper (MDEV-371). row_end is added to
unique index. So when row_end is updated unique hash index must be
recalculated via vcol_update_fields(). DELETE did not update virtual
fields, so DELETE HISTORY was getting wrong hash value.

The fix does update_virtual_fields() on vers_update_end() so in every
case row_end is updated virtual fields are updated as well.
This commit is contained in:
Aleksey Midenkov
2024-10-08 13:08:10 +03:00
parent d37bb140b1
commit 706a8bcb5b
4 changed files with 26 additions and 4 deletions

View File

@ -1810,10 +1810,6 @@ int vers_insert_history_row(TABLE *table)
if (row_start->cmp(row_start->ptr, row_end->ptr) >= 0)
return 0;
if (table->vfield &&
table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_READ))
return HA_ERR_GENERIC;
return table->file->ha_write_row(table->record[0]);
}