]> source.dussan.org Git - jackcess.git/commitdiff
require writeable index for system catalog
authorJames Ahlborn <jtahlborn@yahoo.com>
Sat, 16 Apr 2011 01:11:02 +0000 (01:11 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Sat, 16 Apr 2011 01:11:02 +0000 (01:11 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@551 f203690c-595d-4dc9-a70b-905162fa7fd2

src/java/com/healthmarketscience/jackcess/Database.java
src/java/com/healthmarketscience/jackcess/IndexData.java

index 3691e22a55d9b84a8e39588e0ec674e7871b96d9..9156a461b2706e5e5903a9a59de1e56ab41eeb53 100644 (file)
@@ -2003,6 +2003,9 @@ public class Database
 
     private DefaultTableFinder(IndexCursor systemCatalogCursor) {
       _systemCatalogCursor = systemCatalogCursor;
+      if(_systemCatalogCursor.getIndex().getIndexData().isReadOnly()) {
+        throw new IllegalArgumentException("Unusable index");
+      }
     }
 
     @Override
index 245bd8424d76da352867266670d0cb4a9e3e7d6e..87e23a78ad39ea7c5ececd689b64ad481a948090 100644 (file)
@@ -322,6 +322,10 @@ public abstract class IndexData {
     _readOnly = true;
   }
 
+  protected boolean isReadOnly() {
+    return _readOnly;
+  }
+
   protected int getMaxPageEntrySize() {
     return _maxPageEntrySize;
   }