提交 145985ce authored 作者: Thomas Mueller's avatar Thomas Mueller

When using temporary table, the database didn't shrink sometimes when closing.

上级 fa002664
...@@ -18,7 +18,8 @@ Change Log ...@@ -18,7 +18,8 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>Large transactions could run out of heap space. Fixed. <ul><li>When using temporary table, the database didn't shrink sometimes when closing.
</li><li>Large transactions could run out of heap space. Fixed.
</li><li>The default setting for the system property h2.webMaxValueLength is now 100000 (it was 10000 before). </li><li>The default setting for the system property h2.webMaxValueLength is now 100000 (it was 10000 before).
</li><li>Creating a database was delayed about 2 seconds if the directory didn't exist. </li><li>Creating a database was delayed about 2 seconds if the directory didn't exist.
</li><li>Implemented INIT feature. If the database URL contains ";INIT=...;" then the DDL or DML commands </li><li>Implemented INIT feature. If the database URL contains ";INIT=...;" then the DDL or DML commands
......
...@@ -1061,8 +1061,9 @@ public class PageStore implements CacheWriter { ...@@ -1061,8 +1061,9 @@ public class PageStore implements CacheWriter {
openIndex.truncate(systemSession); openIndex.truncate(systemSession);
openIndex.remove(systemSession); openIndex.remove(systemSession);
removeMetaIndex(openIndex, systemSession); removeMetaIndex(openIndex, systemSession);
} else {
openIndex.close(systemSession);
} }
openIndex.close(systemSession);
} }
allocatePage(PAGE_ID_META_ROOT); allocatePage(PAGE_ID_META_ROOT);
writeIndexRowCounts(); writeIndexRowCounts();
...@@ -1585,4 +1586,20 @@ public class PageStore implements CacheWriter { ...@@ -1585,4 +1586,20 @@ public class PageStore implements CacheWriter {
return changeCount; return changeCount;
} }
int getLogFirstTrunkPage() {
return logFirstTrunkPage;
}
int getLogKey() {
return logKey;
}
public PageLog getLog() {
return log;
}
int getLogFirstDataPage() {
return logFirstDataPage;
}
} }
...@@ -35,6 +35,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -35,6 +35,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
} }
public void test() throws Exception { public void test() throws Exception {
testDropAll();
testCloseTempTable(); testCloseTempTable();
testDuplicateKey(); testDuplicateKey();
testUpdateOverflow(); testUpdateOverflow();
...@@ -56,6 +57,22 @@ public class TestPageStore extends TestBase implements DatabaseEventListener { ...@@ -56,6 +57,22 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
testFuzzOperations(); testFuzzOperations();
} }
private void testDropAll() throws SQLException {
deleteDb("pageStore");
Connection conn;
String url = "pageStore";
conn = getConnection(url);
Statement stat = conn.createStatement();
stat.execute("CREATE TEMP TABLE A(A INT)");
stat.execute("CREATE TABLE B(A VARCHAR IDENTITY)");
stat.execute("CREATE TEMP TABLE C(A INT)");
conn.close();
conn = getConnection(url);
stat = conn.createStatement();
stat.execute("DROP ALL OBJECTS");
conn.close();
}
private void testCloseTempTable() throws SQLException { private void testCloseTempTable() throws SQLException {
deleteDb("pageStore"); deleteDb("pageStore");
Connection conn; Connection conn;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论