From 28045b27be52a2f8ac41900051612f5640cea165 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 3 Apr 2007 16:54:46 +0000 Subject: [PATCH] Fixed bug #1017: assert failure in isamb for delete of records. Problem was that root ptr of sort ISAMB was not properly flushed to disk when it changed. --- isamb/isamb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/isamb/isamb.c b/isamb/isamb.c index 51a0f98..9d4d400 100644 --- a/isamb/isamb.c +++ b/isamb/isamb.c @@ -1,4 +1,4 @@ -/* $Id: isamb.c,v 1.92 2007-02-24 16:46:22 adam Exp $ +/* $Id: isamb.c,v 1.93 2007-04-03 16:54:46 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -331,7 +331,11 @@ ISAMB isamb_open2(BFiles bfs, const char *name, int writeflag, ISAMC_M *method, decode_ptr(&src, &isamb->root_ptr); } assert (isamb->file[i].head.block_size >= isamb->file[i].head.block_offset); - isamb->file[i].head_dirty = 0; + /* must rewrite the header if root ptr is in use (bug #1017) */ + if (use_root_ptr && writeflag) + isamb->file[i].head_dirty = 1; + else + isamb->file[i].head_dirty = 0; assert(isamb->file[i].head.block_size == sizes[i]); } #if ISAMB_DEBUG @@ -454,6 +458,7 @@ void isamb_close (ISAMB isamb) yaz_log(YLOG_DEBUG, "isamb_close returned "ZINT_FORMAT" values, " "skipped "ZINT_FORMAT, isamb->skipped_numbers, isamb->returned_numbers); + for (i = 0; ino_cat; i++) { flush_blocks (isamb, i); -- 1.7.10.4