From: James Ahlborn Date: Thu, 3 Apr 2008 02:56:44 +0000 (+0000) Subject: clear nextPageNumber for held dataPage X-Git-Tag: rel_1_1_14~40 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ea664f7a7de7255a6a2abec707eddad54312780d;p=jackcess.git clear nextPageNumber for held dataPage git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@307 f203690c-595d-4dc9-a70b-905162fa7fd2 --- diff --git a/src/java/com/healthmarketscience/jackcess/SimpleIndex.java b/src/java/com/healthmarketscience/jackcess/SimpleIndex.java index 80fa917..fea96e8 100644 --- a/src/java/com/healthmarketscience/jackcess/SimpleIndex.java +++ b/src/java/com/healthmarketscience/jackcess/SimpleIndex.java @@ -93,15 +93,18 @@ public class SimpleIndex extends Index { // save the first leaf page _dataPage = indexPage; + nextPageNumber = indexPage.getNextPageNumber(); + _dataPage.setNextPageNumber(INVALID_INDEX_PAGE_NUMBER); + indexPage = null; // read all leaf pages. - while(indexPage.getNextPageNumber() != INVALID_INDEX_PAGE_NUMBER) { + while(nextPageNumber != INVALID_INDEX_PAGE_NUMBER) { // FIXME we can't modify this index at this point in time setReadOnly(); // found another one - indexPage = new SimpleDataPage(indexPage.getNextPageNumber()); + indexPage = new SimpleDataPage(nextPageNumber); readDataPage(indexPage); // since we read all the entries in sort order, we can insert them @@ -110,6 +113,7 @@ public class SimpleIndex extends Index { int totalSize = (_dataPage.getTotalEntrySize() + indexPage.getTotalEntrySize()); _dataPage.setTotalEntrySize(totalSize); + nextPageNumber = indexPage.getNextPageNumber(); } // check the entry order, just to be safe