From b9571d48eebc0866750e54787cf6d9cbf8b1e95e Mon Sep 17 00:00:00 2001 From: skidder Date: Sat, 5 Jul 2008 19:31:52 +0000 Subject: [PATCH] When GFIX is invoked with -MEND option it marks blobs and records with inconsistencies as damaged (rhd_damaged). When later GBAK is invoked with -IGNORE option it instructs the engine to skip such marked blobs and records to be able to create backup of the database. However, for damaged BLOBs the engine returns inconsistent statistics via isc_blob_info call making GBAK to fail defeating the purpose of GFIX -MEND. This problem is present in all Firebird versions. This patch corrects the above behavior, and makes the engine return damaged blobs to GBAK with -IGNORE option as consistent zero-length blobs permitting database backup to succeed. --- src/jrd/blb.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jrd/blb.cpp b/src/jrd/blb.cpp index 76c3ab459d..571d2c95ba 100644 --- a/src/jrd/blb.cpp +++ b/src/jrd/blb.cpp @@ -1360,7 +1360,11 @@ blb* BLB_open2(thread_db* tdbb, if (blob->blb_flags & BLB_damaged) { if (!(dbb->dbb_flags & DBB_damaged)) IBERROR(194); // msg 194 blob not found + blob->blb_flags |= BLB_eof; + blob->blb_count = 0; + blob->blb_max_segment = 0; + blob->blb_length = 0; return blob; }