提交 864b1958 authored 作者: Thomas Mueller's avatar Thomas Mueller

If a database file in the PageStore file format exists, this file and this mode…

If a database file in the PageStore file format exists, this file and this mode is now used, even if the database URL does not contain "MV_STORE=FALSE". If a MVStore file exists, it is used.
上级 bb4fd5dd
...@@ -18,7 +18,17 @@ Change Log ...@@ -18,7 +18,17 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>MVStore: the ObjectDataType comparison method was incorrect if one <ul><li>When using the PageStore, opening a database failed in some cases with a NullPointerException
if temporary tables were used (explicitly, or implicitly when using large result sets).
</li><li>If a database file in the PageStore file format exists, this file and this mode
is now used, even if the database URL does not contain "MV_STORE=FALSE".
If a MVStore file exists, it is used.
</li><li>Databases created with version 1.3.175 and earlier
that contained foreign keys in combination with multi-column indexes
could not be opened in some cases.
This was due to a bugfix in version 1.3.176:
Referential integrity constraints sometimes used the wrong index.
</li><li>MVStore: the ObjectDataType comparison method was incorrect if one
key was Serializable and the other was of a common class. key was Serializable and the other was of a common class.
</li><li>Recursive queries with many result rows (more than the setting "max_memory_rows") </li><li>Recursive queries with many result rows (more than the setting "max_memory_rows")
did not work correctly. did not work correctly.
......
...@@ -584,6 +584,9 @@ public class Database implements DataHandler { ...@@ -584,6 +584,9 @@ public class Database implements DataHandler {
if (existsMv && !FileUtils.canWrite(mvFileName)) { if (existsMv && !FileUtils.canWrite(mvFileName)) {
readOnly = true; readOnly = true;
} }
if (existsPage && !existsMv) {
dbSettings.mvStore = false;
}
if (readOnly) { if (readOnly) {
if (traceLevelFile >= TraceSystem.DEBUG) { if (traceLevelFile >= TraceSystem.DEBUG) {
String traceFile = Utils.getProperty("java.io.tmpdir", ".") + String traceFile = Utils.getProperty("java.io.tmpdir", ".") +
......
...@@ -327,7 +327,7 @@ public class DbSettings extends SettingsBase { ...@@ -327,7 +327,7 @@ public class DbSettings extends SettingsBase {
* (default: false).<br /> * (default: false).<br />
* Use the MVStore storage engine. * Use the MVStore storage engine.
*/ */
public final boolean mvStore = get("MV_STORE", Constants.VERSION_MINOR >= 4); public boolean mvStore = get("MV_STORE", Constants.VERSION_MINOR >= 4);
/** /**
* Database setting <code>COMPRESS</code> * Database setting <code>COMPRESS</code>
......
...@@ -49,6 +49,7 @@ public class TestMVTableEngine extends TestBase { ...@@ -49,6 +49,7 @@ public class TestMVTableEngine extends TestBase {
@Override @Override
public void test() throws Exception { public void test() throws Exception {
testOldAndNew();
testTemporaryTables(); testTemporaryTables();
testUniqueIndex(); testUniqueIndex();
testSecondaryIndex(); testSecondaryIndex();
...@@ -79,6 +80,34 @@ public class TestMVTableEngine extends TestBase { ...@@ -79,6 +80,34 @@ public class TestMVTableEngine extends TestBase {
testSimple(); testSimple();
} }
private void testOldAndNew() throws SQLException {
FileUtils.deleteRecursive(getBaseDir(), true);
Connection conn;
String urlOld = getURL("mvstore;MV_STORE=FALSE", true);
String urlNew = getURL("mvstore;MV_STORE=TRUE", true);
String url = getURL("mvstore", true);
conn = getConnection(urlOld);
conn.createStatement().execute("create table test_old(id int)");
conn.close();
conn = getConnection(url);
conn.createStatement().execute("select * from test_old");
conn.close();
conn = getConnection(urlNew);
conn.createStatement().execute("create table test_new(id int)");
conn.close();
conn = getConnection(url);
conn.createStatement().execute("select * from test_new");
conn.close();
conn = getConnection(urlOld);
conn.createStatement().execute("select * from test_old");
conn.close();
conn = getConnection(urlNew);
conn.createStatement().execute("select * from test_new");
conn.close();
}
private void testTemporaryTables() throws SQLException { private void testTemporaryTables() throws SQLException {
FileUtils.deleteRecursive(getBaseDir(), true); FileUtils.deleteRecursive(getBaseDir(), true);
Connection conn; Connection conn;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论