From 09a9f3809227e3e883571c978865a228db6d6e63 Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Sat, 16 Apr 2011 01:11:02 +0000 Subject: [PATCH] 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 --- src/java/com/healthmarketscience/jackcess/Database.java | 3 +++ src/java/com/healthmarketscience/jackcess/IndexData.java | 4 ++++ 2 files changed, 7 insertions(+) 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; } -- 2.39.5