From 06cef3aac0230e856f36e61533e2a4e60f299a02 Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Wed, 6 Dec 1995 15:48:44 +0000 Subject: [PATCH] Fixed update-problem. --- isam/isam.c | 7 +++++-- isam/memory.c | 11 +++++++---- isam/memory.h | 7 +++++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/isam/isam.c b/isam/isam.c index 6beb3dc..248a944 100644 --- a/isam/isam.c +++ b/isam/isam.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: isam.c,v $ - * Revision 1.16 1995-12-06 14:48:26 quinn + * Revision 1.17 1995-12-06 15:48:44 quinn + * Fixed update-problem. + * + * Revision 1.16 1995/12/06 14:48:26 quinn * Fixed some strange bugs. * * Revision 1.15 1995/12/06 09:59:45 quinn @@ -470,7 +473,7 @@ void is_pt_free(ISPT ip) */ int is_readkey(ISPT ip, void *buf) { - return is_m_read_record(&ip->tab, buf); + return is_m_read_record(&ip->tab, buf, 0); } int is_numkeys(ISPT ip) diff --git a/isam/memory.c b/isam/memory.c index 475b5fc..afb7887 100644 --- a/isam/memory.c +++ b/isam/memory.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: memory.c,v $ - * Revision 1.8 1995-12-06 14:48:27 quinn + * Revision 1.9 1995-12-06 15:48:46 quinn + * Fixed update-problem. + * + * Revision 1.8 1995/12/06 14:48:27 quinn * Fixed some strange bugs. * * Revision 1.7 1995/12/06 09:59:46 quinn @@ -337,7 +340,7 @@ int is_m_peek_record(is_mtable *tab, void *rec) return 1; } -int is_m_read_record(is_mtable *tab, void *buf) +int is_m_read_record(is_mtable *tab, void *buf, int keep) { is_mbuf *mbuf; @@ -350,7 +353,7 @@ int is_m_read_record(is_mtable *tab, void *buf) { if (!mbuf->next) /* end of mblock */ { - if (tab->cur_mblock->state == IS_MBSTATE_CLEAN && + if (!keep && tab->cur_mblock->state == IS_MBSTATE_CLEAN && tab->cur_mblock->diskpos > 0) { xfree_mbufs(tab->cur_mblock->data); @@ -388,7 +391,7 @@ int is_m_seek_record(is_mtable *tab, const void *rec) for (;;) { - if (is_m_read_record(tab, &peek) <= 0) + if (is_m_read_record(tab, &peek, 1) <= 0) return 1; if ((rs = (*tab->is->cmp)(peek, rec)) > 0) { diff --git a/isam/memory.h b/isam/memory.h index 2f92ee0..d082556 100644 --- a/isam/memory.h +++ b/isam/memory.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: memory.h,v $ - * Revision 1.3 1994-09-28 16:58:33 quinn + * Revision 1.4 1995-12-06 15:48:47 quinn + * Fixed update-problem. + * + * Revision 1.3 1994/09/28 16:58:33 quinn * Small mod. * * Revision 1.2 1994/09/27 20:03:52 quinn @@ -90,7 +93,7 @@ void is_m_rewind(is_mtable *tab); void is_m_replace_record(is_mtable *tab, const void *rec); int is_m_write_record(is_mtable *tab, const void *rec); void is_m_unread_record(is_mtable *tab); -int is_m_read_record(is_mtable *tab, void *buf); +int is_m_read_record(is_mtable *tab, void *buf, int keep); int is_m_seek_record(is_mtable *tab, const void *rec); void is_m_delete_record(is_mtable *tab); int is_m_peek_record(is_mtable *tab, void *rec); -- 1.7.10.4