From 2b11a0e9918ac6b04d821fdbe4192475f516946a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 20 Jul 2025 13:00:23 +0200 Subject: [PATCH] MDEV-37268 assert upon UPDATE or partitioned table with unique hash under READ-COMMITTED followup for 9703c90712f3 (MDEV-37199 UNIQUE KEY USING HASH accepting duplicate records) maintain the invariant, that handler::ha_update_row() is always invoked as handler::ha_update_row(record[0], record[1]) --- sql/handler.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/handler.cc b/sql/handler.cc index 1ae75ff94d3..4ca785d1c32 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -7863,9 +7863,13 @@ int handler::ha_update_row(const uchar *old_data, const uchar *new_data) return HA_ERR_UNSUPPORTED; } } + table->move_fields(table->field, table->record[1], table->record[0]); + std::swap(table->record[0], table->record[1]); increment_statistics(&SSV::ha_update_count); TABLE_IO_WAIT(tracker, PSI_TABLE_UPDATE_ROW, MAX_KEY, e, { e= update_row(new_data, old_data);}) + table->move_fields(table->field, table->record[1], table->record[0]); + std::swap(table->record[0], table->record[1]); } return e ? e : error; }