1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +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

@@ -224,3 +224,14 @@ ERROR HY000: The target table v1 of the DELETE is not updatable
DROP VIEW v1;
DROP TABLE t1;
# End of 10.4 tests
#
# MDEV-33470 Unique hash index is broken on DML for system-versioned table
#
create or replace table t (
c int, unique (c) using hash)
with system versioning;
insert into t values (0);
delete from t;
delete history from t;
drop table t;
# End of 10.5 tests