提交 9f08bd03 authored 作者: Thomas Mueller's avatar Thomas Mueller

Deleting a database using the tool DeleteDbFiles deleted LOB files of other…

Deleting a database using the tool DeleteDbFiles deleted LOB files of other databases in the same directory.
上级 7495f1f5
...@@ -55,7 +55,9 @@ public class TestTools extends TestBase { ...@@ -55,7 +55,9 @@ public class TestTools extends TestBase {
if (config.networked) { if (config.networked) {
return; return;
} }
org.h2.Driver.load();
deleteDb("utils"); deleteDb("utils");
testDeleteFiles();
testScriptRunscriptLob(); testScriptRunscriptLob();
deleteDb("utils"); deleteDb("utils");
testServerMain(); testServerMain();
...@@ -70,10 +72,25 @@ public class TestTools extends TestBase { ...@@ -70,10 +72,25 @@ public class TestTools extends TestBase {
deleteDb("utils"); deleteDb("utils");
} }
private void testDeleteFiles() throws SQLException {
DeleteDbFiles.execute(null, "utilsMore", true);
Connection conn = DriverManager.getConnection("jdbc:h2:utilsMore");
Statement stat = conn.createStatement();
stat.execute("create table test(c clob) as select space(10000) from dual");
conn.close();
DeleteDbFiles.execute(null, "utils", true);
conn = DriverManager.getConnection("jdbc:h2:utilsMore");
stat = conn.createStatement();
ResultSet rs;
rs = stat.executeQuery("select * from test");
rs.next();
rs.getString(1);
conn.close();
}
private void testServerMain() throws SQLException { private void testServerMain() throws SQLException {
String result; String result;
Connection conn; Connection conn;
org.h2.Driver.load();
result = runServer(new String[]{"-?"}, 1); result = runServer(new String[]{"-?"}, 1);
assertTrue(result.indexOf("Starts H2 Servers") >= 0); assertTrue(result.indexOf("Starts H2 Servers") >= 0);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论