From 4ee04fea4422f46810b9a33d7d7ce2f7cf04a0f8 Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Thu, 11 Sep 2008 03:42:05 +0000 Subject: [PATCH] Fix simple index handling of tail index pages (2043499) git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@373 f203690c-595d-4dc9-a70b-905162fa7fd2 --- src/changes/changes.xml | 5 +++++ .../healthmarketscience/jackcess/SimpleIndex.java | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 1d7342f..3acf985 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -5,6 +5,11 @@ James Ahlborn + + + Fix simple index handling of tail index pages. + + Reserve minimum space for memo/ole fields so that greedy inline row diff --git a/src/java/com/healthmarketscience/jackcess/SimpleIndex.java b/src/java/com/healthmarketscience/jackcess/SimpleIndex.java index 35ef662..60117e5 100644 --- a/src/java/com/healthmarketscience/jackcess/SimpleIndex.java +++ b/src/java/com/healthmarketscience/jackcess/SimpleIndex.java @@ -68,7 +68,12 @@ public class SimpleIndex extends Index { setReadOnly(); // found another node page - nextPageNumber = indexPage.getEntries().get(0).getSubPageNumber(); + if(!indexPage.getEntries().isEmpty()) { + nextPageNumber = indexPage.getEntries().get(0).getSubPageNumber(); + } else { + // try tail page + nextPageNumber = indexPage.getChildTailPageNumber(); + } indexPage = null; } else { // found first leaf @@ -136,6 +141,7 @@ public class SimpleIndex extends Index { private boolean _leaf; private int _nextPageNumber; private int _totalEntrySize; + private int _childTailPageNumber; private List _entries; private SimpleDataPage(int pageNumber) { @@ -171,10 +177,12 @@ public class SimpleIndex extends Index { _nextPageNumber = pageNumber; } @Override - public int getChildTailPageNumber() { return 0; } + public int getChildTailPageNumber() { + return _childTailPageNumber; + } @Override public void setChildTailPageNumber(int pageNumber) { - // ignored + _childTailPageNumber = pageNumber; } @Override -- 2.39.5