Unverified 提交 d58788be authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #1078 from grandinj/1023_mvcc

#1023: MVCC and existing page store file
......@@ -21,6 +21,8 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul>
<li>Issue #1023: MVCC and existing page store file
</li>
<li>Issue #1003: Decrypting database with incorrect password renders the database corrupt
</li>
<li>Issue #873: No error when `=` in equal condition when column is not of array type
......
......@@ -166,6 +166,7 @@ public class Database implements DataHandler {
private final String cacheType;
private final String accessModeData;
private boolean referentialIntegrity = true;
/** ie. the MVCC setting */
private boolean multiVersion;
private DatabaseCloser closeOnExit;
private Mode mode = Mode.getRegular();
......@@ -279,13 +280,13 @@ public class Database implements DataHandler {
TraceSystem.DEFAULT_TRACE_LEVEL_SYSTEM_OUT);
this.cacheType = StringUtils.toUpperEnglish(
ci.removeProperty("CACHE_TYPE", Constants.CACHE_TYPE_DEFAULT));
openDatabase(traceLevelFile, traceLevelSystemOut, closeAtVmShutdown);
openDatabase(traceLevelFile, traceLevelSystemOut, closeAtVmShutdown, ci);
}
private void openDatabase(int traceLevelFile, int traceLevelSystemOut,
boolean closeAtVmShutdown) {
boolean closeAtVmShutdown, ConnectionInfo ci) {
try {
open(traceLevelFile, traceLevelSystemOut);
open(traceLevelFile, traceLevelSystemOut, ci);
if (closeAtVmShutdown) {
try {
closeOnExit = new DatabaseCloser(this, 0, true);
......@@ -608,7 +609,7 @@ public class Database implements DataHandler {
return dbSettings.databaseToUpper ? StringUtils.toUpperEnglish(n) : n;
}
private synchronized void open(int traceLevelFile, int traceLevelSystemOut) {
private synchronized void open(int traceLevelFile, int traceLevelSystemOut, ConnectionInfo ci) {
if (persistent) {
String dataFileName = databaseName + Constants.SUFFIX_OLD_DATABASE_FILE;
boolean existsData = FileUtils.exists(dataFileName);
......@@ -631,6 +632,9 @@ public class Database implements DataHandler {
}
if (existsPage && !existsMv) {
dbSettings.mvStore = false;
// Need to re-init this because the first time we do it we don't
// know if we have an mvstore or a pagestore.
multiVersion = ci.getProperty("MVCC", false);
}
if (readOnly) {
if (traceLevelFile >= TraceSystem.DEBUG) {
......
......@@ -6,7 +6,6 @@
package org.h2.engine;
import java.util.HashMap;
import org.h2.message.DbException;
import org.h2.util.Utils;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论