From 09a3da9a49445fd357e4f13ccc1598f8c32af0e7 Mon Sep 17 00:00:00 2001 From: "Bradley C. Kuszmaul" Date: Fri, 8 Feb 2008 04:34:12 +0000 Subject: [PATCH] Make all.recover work again. Addresses #27. git-svn-id: file:///svn/tokudb@2168 c7de825b-a66e-492c-adef-691d508d4ae1 --- newbrt/roll.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/newbrt/roll.c b/newbrt/roll.c index 99e205b79f4..0683e1b59e8 100644 --- a/newbrt/roll.c +++ b/newbrt/roll.c @@ -243,9 +243,11 @@ void toku_recover_addchild (struct logtype_addchild *le) { assert(i>=2); node->u.n.childkeys [i-1] = node->u.n.childkeys [i-2]; } - node->u.n.childinfos[le->childnum].subtree_fingerprint = le->childfingerprint; + if (le->childnum>0) { + node->u.n.childkeys [le->childnum-1] = 0; + } BNC_DISKOFF(node, le->childnum) = le->child; - node->u.n.childkeys [le->childnum-1] = 0; + BNC_SUBTREE_FINGERPRINT(node, le->childnum) = le->childfingerprint; int r= toku_fifo_create(&BNC_BUFFER(node, le->childnum)); assert(r==0); BNC_NBYTESINBUF(node, le->childnum) = 0; node->u.n.n_children++;