summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2011-04-16 01:11:02 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2011-04-16 01:11:02 +0000
commit09a9f3809227e3e883571c978865a228db6d6e63 (patch)
treec1a2da2f61820134c5207500eef4582875257fd4
parentc10c32949f369d7f1b3fa6c6d90eba88c89a38ac (diff)
downloadjackcess-09a9f3809227e3e883571c978865a228db6d6e63.tar.gz
jackcess-09a9f3809227e3e883571c978865a228db6d6e63.zip
require writeable index for system catalog
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@551 f203690c-595d-4dc9-a70b-905162fa7fd2
-rw-r--r--src/java/com/healthmarketscience/jackcess/Database.java3
-rw-r--r--src/java/com/healthmarketscience/jackcess/IndexData.java4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Database.java b/src/java/com/healthmarketscience/jackcess/Database.java
index 3691e22..9156a46 100644
--- a/src/java/com/healthmarketscience/jackcess/Database.java
+++ b/src/java/com/healthmarketscience/jackcess/Database.java
@@ -2003,6 +2003,9 @@ public class Database
private DefaultTableFinder(IndexCursor systemCatalogCursor) {
_systemCatalogCursor = systemCatalogCursor;
+ if(_systemCatalogCursor.getIndex().getIndexData().isReadOnly()) {
+ throw new IllegalArgumentException("Unusable index");
+ }
}
@Override
diff --git a/src/java/com/healthmarketscience/jackcess/IndexData.java b/src/java/com/healthmarketscience/jackcess/IndexData.java
index 245bd84..87e23a7 100644
--- a/src/java/com/healthmarketscience/jackcess/IndexData.java
+++ b/src/java/com/healthmarketscience/jackcess/IndexData.java
@@ -322,6 +322,10 @@ public abstract class IndexData {
_readOnly = true;
}
+ protected boolean isReadOnly() {
+ return _readOnly;
+ }
+
protected int getMaxPageEntrySize() {
return _maxPageEntrySize;
}