diff options
-rw-r--r-- | src/changes/changes.xml | 5 | ||||
-rw-r--r-- | src/java/com/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 @@ <author email="jahlborn@users.sf.net">James Ahlborn</author> </properties> <body> + <release version="1.1.17" date="TBD"> + <action dev="jahlborn" type="fix" issue="2043499"> + Fix simple index handling of tail index pages. + </action> + </release> <release version="1.1.16" date="2008-07-24"> <action dev="jahlborn" type="fix" issue="2019244"> 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<Entry> _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 |