summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2008-04-17 02:09:16 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2008-04-17 02:09:16 +0000
commit6f9ccc356d24f21bff5675a5bc7bd228fc9f32a4 (patch)
treed2642b73e9558de51dc028c48262a38891ca12ea /src
parent6845efc53cc544de8466c42c9f43364245889f0b (diff)
downloadjackcess-6f9ccc356d24f21bff5675a5bc7bd228fc9f32a4.tar.gz
jackcess-6f9ccc356d24f21bff5675a5bc7bd228fc9f32a4.zip
more big index tests; minor bug fix
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@334 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src')
-rw-r--r--src/java/com/healthmarketscience/jackcess/IndexPageCache.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/IndexPageCache.java b/src/java/com/healthmarketscience/jackcess/IndexPageCache.java
index f8046d4..0c0d890 100644
--- a/src/java/com/healthmarketscience/jackcess/IndexPageCache.java
+++ b/src/java/com/healthmarketscience/jackcess/IndexPageCache.java
@@ -610,6 +610,7 @@ public class IndexPageCache
// clear the root page
rootMain._leaf = false;
+ rootMain._childTailPageNumber = INVALID_INDEX_PAGE_NUMBER;
rootExtra._entries = new ArrayList<Entry>();
rootExtra._entryPrefix = EMPTY_PREFIX;
rootExtra._totalEntrySize = 0;
@@ -869,6 +870,7 @@ public class IndexPageCache
throw new IllegalStateException("Prev page " + prevMain +
" does not ref " + dpMain);
}
+ validatePeerStatus(dpMain, prevMain);
}
DataPageMain nextMain = _dataPages.get(dpMain._nextPageNumber);
@@ -877,6 +879,25 @@ public class IndexPageCache
throw new IllegalStateException("Next page " + nextMain +
" does not ref " + dpMain);
}
+ validatePeerStatus(dpMain, nextMain);
+ }
+ }
+
+ private void validatePeerStatus(DataPageMain dpMain, DataPageMain peerMain)
+ throws IOException
+ {
+ if(dpMain._leaf != peerMain._leaf) {
+ throw new IllegalStateException("Mismatched peer status " +
+ dpMain._leaf + " " + peerMain._leaf);
+ }
+ if(!dpMain._leaf) {
+ if((dpMain._parentPageNumber != null) &&
+ (peerMain._parentPageNumber != null) &&
+ ((int)dpMain._parentPageNumber != (int)peerMain._parentPageNumber)) {
+ throw new IllegalStateException("Mismatched node parents " +
+ dpMain._parentPageNumber + " " +
+ peerMain._parentPageNumber);
+ }
}
}