From: James Ahlborn Date: Sat, 16 Apr 2011 01:11:02 +0000 (+0000) Subject: require writeable index for system catalog X-Git-Tag: jackcess-1.2.4~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=09a9f3809227e3e883571c978865a228db6d6e63;p=jackcess.git 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 --- 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; }