Attempt at fixing bug. Not all blocks were read before they were unlinked
authorSebastian Hammer <quinn@indexdata.com>
Tue, 6 Feb 1996 10:19:56 +0000 (10:19 +0000)
committerSebastian Hammer <quinn@indexdata.com>
Tue, 6 Feb 1996 10:19:56 +0000 (10:19 +0000)
prior to a remap operation.

isam/isam.c
isam/physical.c

index 248a944..4a160a8 100644 (file)
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: isam.c,v $
- * Revision 1.17  1995-12-06 15:48:44  quinn
+ * Revision 1.18  1996-02-06 10:19:56  quinn
+ * Attempt at fixing bug. Not all blocks were read before they were unlinked
+ * prior to a remap operation.
+ *
+ * Revision 1.17  1995/12/06  15:48:44  quinn
  * Fixed update-problem.
  *
  * Revision 1.16  1995/12/06  14:48:26  quinn
@@ -427,6 +431,10 @@ ISAM_P is_merge(ISAM is, ISAM_P pos, int num, char *data)
        i++;
     if (i != tab.pos_type)
     {
+       /* read remaining blocks */
+       for (; tab.cur_mblock; tab.cur_mblock = tab.cur_mblock->next)
+           if (tab.cur_mblock->state < IS_MBSTATE_CLEAN)
+               is_m_read_full(&tab, tab.cur_mblock);
        is_p_unmap(&tab);
        tab.pos_type = i;
     }
index 310960b..6779a89 100644 (file)
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: physical.c,v $
- * Revision 1.8  1996-01-29 09:47:11  quinn
+ * Revision 1.9  1996-02-06 10:19:57  quinn
+ * Attempt at fixing bug. Not all blocks were read before they were unlinked
+ * prior to a remap operation.
+ *
+ * Revision 1.8  1996/01/29  09:47:11  quinn
  * Fixed mean little bug in the read-table code.
  *
  * Revision 1.7  1995/12/06  14:48:27  quinn
@@ -81,7 +85,7 @@ int is_p_read_partial(is_mtable *tab, is_mblock *block)
     is_mbuf *buf;
 
     assert(block->state == IS_MBSTATE_UNREAD);
-    block->data = buf =  xmalloc_mbuf(IS_MBUF_TYPE_LARGE);
+    block->data = buf = xmalloc_mbuf(IS_MBUF_TYPE_LARGE);
     toread = tab->is->types[tab->pos_type].blocksize;
     if (toread > is_mbuf_size[buf->type])
     {
@@ -225,11 +229,13 @@ void is_p_unmap(is_mtable *tab)
     is_mblock *p;
 
     for (p = tab->data; p; p = p->next)
+    {
        if (p->diskpos >= 0)
        {
            is_freestore_free(tab->is, tab->pos_type, p->diskpos);
            p->diskpos = -1;
        }
+    }
 }
 
 static is_mbuf *mbuf_takehead(is_mbuf **mb, int *num, int keysize)