From 94689092961b22e83bc070aef9da7f7004bc8af9 Mon Sep 17 00:00:00 2001 From: Ilya Eremin Date: Fri, 14 Nov 2025 14:13:25 +0300 Subject: [PATCH] Fix #8799: BUGCHECK "decompression overran buffer (179)" when WITH LOCK clause is used VIO_writelock creates new_rpb by copying from org_rpb which has rpb_delta flag set. new_rpb is passed to prepare_update. It creates a delta but its size exceeds the limit (1024) so the current version is stored as a regular record. The problem is that rpb_delta flag remains set for new_rpb, and then replace_record sets it in the header of the primary version. From this moment any attempt to get data of older versions fails. --- src/jrd/vio.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jrd/vio.cpp b/src/jrd/vio.cpp index 78a3a7f5435..67c74a6dcb0 100644 --- a/src/jrd/vio.cpp +++ b/src/jrd/vio.cpp @@ -6557,6 +6557,8 @@ static PrepareResult prepare_update(thread_db* tdbb, jrd_tra* transaction, TraNu if (new_rpb) { + new_rpb->rpb_flags &= ~rpb_delta; + // If both descriptors share the same record, there cannot be any difference. // This trick is used by VIO_writelock(), but can be a regular practice as well. if (new_rpb->rpb_address == temp->rpb_address)