From 9c171d3783aa4283efdfae0a020621fe3ab421f5 Mon Sep 17 00:00:00 2001 From: Dmitry Yemanov Date: Wed, 3 Apr 2024 13:25:57 +0300 Subject: [PATCH] Postfix for #7976: False validation error for short unpacked records (this time about short unpacked fragments) --- src/jrd/validation.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/jrd/validation.cpp b/src/jrd/validation.cpp index 1fb9a2f090..46efdbc172 100644 --- a/src/jrd/validation.cpp +++ b/src/jrd/validation.cpp @@ -2805,9 +2805,9 @@ Validation::RTN Validation::walk_record(jrd_rel* relation, const rhd* header, US const auto format = MET_format(vdr_tdbb, relation, header->rhd_format); auto remainingLength = format->fmt_length; - auto calculateLength = [fragment, remainingLength](ULONG length, const UCHAR* data) + auto calculateLength = [remainingLength](ULONG length, const UCHAR* data, bool notPacked) { - if (fragment->rhdf_flags & rhd_not_packed) + if (notPacked) { if (length > remainingLength) { @@ -2826,7 +2826,8 @@ Validation::RTN Validation::walk_record(jrd_rel* relation, const rhd* header, US return Compressor::getUnpackedLength(length, data); }; - remainingLength -= calculateLength(length, p); + bool notPacked = (fragment->rhdf_flags & rhd_not_packed) != 0; + remainingLength -= calculateLength(length, p, notPacked); // Next, chase down fragments, if any @@ -2878,7 +2879,8 @@ Validation::RTN Validation::walk_record(jrd_rel* relation, const rhd* header, US length -= RHD_SIZE; } - remainingLength -= calculateLength(length, p); + notPacked = (fragment->rhdf_flags & rhd_not_packed) != 0; + remainingLength -= calculateLength(length, p, notPacked); page_number = fragment->rhdf_f_page; line_number = fragment->rhdf_f_line;