提交 3d73ab4b authored 作者: Thomas Mueller's avatar Thomas Mueller

Issue 103: MVCC: the setting MAX_MEMORY_UNDO can currently not be supported

上级 d33bf186
...@@ -120,7 +120,7 @@ public class UndoLog { ...@@ -120,7 +120,7 @@ public class UndoLog {
if (!entry.isStored()) { if (!entry.isStored()) {
memoryUndo++; memoryUndo++;
} }
if (memoryUndo > database.getMaxMemoryUndo() && database.isPersistent()) { if (memoryUndo > database.getMaxMemoryUndo() && database.isPersistent() && !database.isMultiVersion()) {
if (file == null) { if (file == null) {
String fileName = database.createTempFile(); String fileName = database.createTempFile();
file = database.openFile(fileName, "rw", false); file = database.openFile(fileName, "rw", false);
......
...@@ -75,6 +75,17 @@ public class TestCases extends TestBase { ...@@ -75,6 +75,17 @@ public class TestCases extends TestBase {
private void testLargeRollback() throws SQLException { private void testLargeRollback() throws SQLException {
deleteDb("cases"); deleteDb("cases");
Connection conn = getConnection("cases"); Connection conn = getConnection("cases");
conn.createStatement().execute("set MAX_MEMORY_UNDO 1");
conn.createStatement().execute("create table test(id number primary key)");
conn.createStatement().execute("insert into test(id) select x from system_range(1, 2)");
Connection conn2 = getConnection("cases");
conn2.setAutoCommit(false);
assertEquals(2, conn2.createStatement().executeUpdate("delete from test"));
conn2.close();
conn.close();
deleteDb("cases");
conn = getConnection("cases");
conn.createStatement().execute("set MAX_MEMORY_UNDO 8"); conn.createStatement().execute("set MAX_MEMORY_UNDO 8");
conn.createStatement().execute("create table test(id number primary key)"); conn.createStatement().execute("create table test(id number primary key)");
conn.setAutoCommit(false); conn.setAutoCommit(false);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论