Fix #8799: BUGCHECK "decompression overran buffer (179)" when WITH LOCK clause is used#8803
Merged
ilya071294 merged 1 commit intoFirebirdSQL:masterfrom Nov 17, 2025
Conversation
…hen 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.
hvlad
reviewed
Nov 17, 2025
Contributor
Author
Yes, but that leaves open the possibility of facing a similar bug again, so I see it as a worse solution.
I thought about it and came to this logic: if |
hvlad
approved these changes
Nov 17, 2025
ilya071294
added a commit
that referenced
this pull request
Nov 17, 2025
…CK clause is used (#8803) 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.
ilya071294
added a commit
that referenced
this pull request
Nov 17, 2025
…CK clause is used (#8803) 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.
ilya071294
added a commit
that referenced
this pull request
Nov 17, 2025
…CK clause is used (#8803) 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VIO_writelockcreatesnew_rpbby copying fromorg_rpbwhich hasrpb_deltaflag set.new_rpbis passed toprepare_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 thatrpb_deltaflag remains set fornew_rpb, and thenreplace_recordsets it in the header of the primary version. From this moment any attempt to get data of older versions fails.The fix is to let
prepare_updateclearrpb_deltaflag fromnew_rpbjust before an attempt to generate a delta.