aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/healthmarketscience/jackcess/DatabaseBuilder.java
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2023-01-12 22:22:29 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2023-01-12 22:22:29 +0000
commitb02d1df66cbd159b1b318405f614827af683bfbb (patch)
tree61fce9d5b55276eaffbe3e6d1439c1040dd6fcb3 /src/main/java/com/healthmarketscience/jackcess/DatabaseBuilder.java
parente8cd3131bdffd29b640175836cbf7edf07b5760c (diff)
downloadjackcess-b02d1df66cbd159b1b318405f614827af683bfbb.tar.gz
jackcess-b02d1df66cbd159b1b318405f614827af683bfbb.zip
Add option to DatabaseBuilder for ignoring broken system catalog indexes. Fixes #46
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1395 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/main/java/com/healthmarketscience/jackcess/DatabaseBuilder.java')
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/DatabaseBuilder.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/DatabaseBuilder.java b/src/main/java/com/healthmarketscience/jackcess/DatabaseBuilder.java
index 18ba994..9b622d9 100644
--- a/src/main/java/com/healthmarketscience/jackcess/DatabaseBuilder.java
+++ b/src/main/java/com/healthmarketscience/jackcess/DatabaseBuilder.java
@@ -77,7 +77,8 @@ public class DatabaseBuilder
private Map<String,PropertyMap.Property> _summaryProps;
/** database user-defined (if any) */
private Map<String,PropertyMap.Property> _userProps;
-
+ /** flag indicating that the system catalog index is borked */
+ private boolean _ignoreBrokenSystemCatalogIndex;
public DatabaseBuilder() {
this((Path)null);
@@ -261,11 +262,22 @@ public class DatabaseBuilder
}
/**
+ * Sets flag which, if {@code true}, will make the database ignore the index
+ * on the system catalog when looking up tables. This will make table
+ * retrieval slower, but can be used to workaround broken indexes.
+ */
+ public DatabaseBuilder setIgnoreBrokenSystemCatalogIndex(boolean ignore) {
+ _ignoreBrokenSystemCatalogIndex = ignore;
+ return this;
+ }
+
+ /**
* Opens an existingnew Database using the configured information.
*/
public Database open() throws IOException {
return DatabaseImpl.open(_mdbFile, _readOnly, _channel, _autoSync, _charset,
- _timeZone, _codecProvider);
+ _timeZone, _codecProvider,
+ _ignoreBrokenSystemCatalogIndex);
}
/**