partial fix for physically deleted records, but logic could benefit from a
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 31 Dec 2004 07:16:02 +0000 (07:16 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 31 Dec 2004 07:16:02 +0000 (07:16 +0000)
bit more work since it's not totally complient with ISIS documentation.

git-svn-id: file:///home/dpavlin/svn/Biblio-Isis/trunk@26 4670fa4d-42ec-0310-ab5b-a66af6943492

IsisDB.pm

index 222e122..df6dc0d 100644 (file)
--- a/IsisDB.pm
+++ b/IsisDB.pm
@@ -331,7 +331,7 @@ sub fetch {
        # (XRFMFB - 1) * 512 + XRFMFP
        # why do i have to do XRFMFP % 1024 ?
 
        # (XRFMFB - 1) * 512 + XRFMFP
        # why do i have to do XRFMFP % 1024 ?
 
-       my $blk_off = (($XRFMFB - 1) * 512) + ($XRFMFP % 1024);
+       my $blk_off = (($XRFMFB - 1) * 512) + ($XRFMFP % 512);
 
        print STDERR "## pointer: $pointer XRFMFB: $XRFMFB XRFMFP: $XRFMFP offset: $blk_off\n" if ($self->{'debug'});
 
 
        print STDERR "## pointer: $pointer XRFMFB: $XRFMFB XRFMFP: $XRFMFP offset: $blk_off\n" if ($self->{'debug'});
 
@@ -345,8 +345,14 @@ sub fetch {
        print STDERR "## offset for rowid $value is $blk_off (blk $XRFMFB off $XRFMFP)\n" if ($self->{debug});
 
        if ($value!=$mfn) {
        print STDERR "## offset for rowid $value is $blk_off (blk $XRFMFB off $XRFMFP)\n" if ($self->{debug});
 
        if ($value!=$mfn) {
-               carp "Error: MFN ".$mfn." not found in MST(".$value.")";    
-               #return;
+               if ($value == 0) {
+                       print STDERR "## record $mfn is physically deleted\n" if ($self->{debug});
+                       $self->{deleted} = $mfn;
+                       return;
+               }
+
+               carp "Error: MFN ".$mfn." not found in MST file, found $value";    
+               return;
        }
 
        read($self->{'fileMST'}, $buff, 14);
        }
 
        read($self->{'fileMST'}, $buff, 14);