From fc5b1ebd4b23c1c55514a973f35ee98f2207597e Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Tue, 6 Feb 1996 10:19:56 +0000 Subject: [PATCH] Attempt at fixing bug. Not all blocks were read before they were unlinked prior to a remap operation. --- isam/isam.c | 10 +++++++++- isam/physical.c | 10 ++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/isam/isam.c b/isam/isam.c index 248a944..4a160a8 100644 --- a/isam/isam.c +++ b/isam/isam.c @@ -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; } diff --git a/isam/physical.c b/isam/physical.c index 310960b..6779a89 100644 --- a/isam/physical.c +++ b/isam/physical.c @@ -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) -- 1.7.10.4