提交 b659edb9 authored 作者: Thomas Mueller's avatar Thomas Mueller

When closing a database, sometimes empty space in the database was not freed up.

上级 5032d2b7
...@@ -204,7 +204,7 @@ public class PageOutputStream { ...@@ -204,7 +204,7 @@ public class PageOutputStream {
reservedPages = new IntArray(); reservedPages = new IntArray();
reserved = 0; reserved = 0;
for (int p : array) { for (int p : array) {
store.free(p); store.free(p, false);
} }
} }
} }
......
...@@ -52,8 +52,23 @@ public class TestPageStoreCoverage extends TestBase { ...@@ -52,8 +52,23 @@ public class TestPageStoreCoverage extends TestBase {
private void testMoveRoot() throws SQLException { private void testMoveRoot() throws SQLException {
Connection conn; Connection conn;
conn = getConnection(URL); conn = getConnection(URL);
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
stat.execute("create memory table test(id int primary key) as select x from system_range(1, 20)");
for (int i = 0; i < 10; i++) {
stat.execute("create memory table test" + i + "(id int primary key) as select x from system_range(1, 2)");
}
stat.execute("drop table test");
conn.close();
conn = getConnection(URL);
stat = conn.createStatement();
stat.execute("drop all objects delete files");
conn.close();
conn = getConnection(URL);
stat = conn.createStatement();
stat.execute("create table test(id int primary key) as select x from system_range(1, 100)"); stat.execute("create table test(id int primary key) as select x from system_range(1, 100)");
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
stat.execute("create table test" + i + "(id int primary key) as select x from system_range(1, 2)"); stat.execute("create table test" + i + "(id int primary key) as select x from system_range(1, 2)");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论