summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2008-09-11 03:42:05 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2008-09-11 03:42:05 +0000
commit4ee04fea4422f46810b9a33d7d7ce2f7cf04a0f8 (patch)
tree073dbf4ccab45404c31053e0b9a8d036a57d4f1a
parent19f784490cf64bb54bd95aae17ff07b43f271763 (diff)
downloadjackcess-4ee04fea4422f46810b9a33d7d7ce2f7cf04a0f8.tar.gz
jackcess-4ee04fea4422f46810b9a33d7d7ce2f7cf04a0f8.zip
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
-rw-r--r--src/changes/changes.xml5
-rw-r--r--src/java/com/healthmarketscience/jackcess/SimpleIndex.java14
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