提交 56fe07ac authored 作者: christian.peter.io's avatar christian.peter.io

Filesystem parameters like "split:" didn't work in server mode with baseDir set.

上级 796a5529
...@@ -20,6 +20,7 @@ Change Log ...@@ -20,6 +20,7 @@ Change Log
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>The experimental LOB storage mechanism now supports all features of the <ul><li>The experimental LOB storage mechanism now supports all features of the
old one. To use it, set the system property "h2.lobInDatabase" to "true". old one. To use it, set the system property "h2.lobInDatabase" to "true".
</li><li>Filesystem parameters like "split:" didn't work in server mode with baseDir set.
</li></ul> </li></ul>
<h2>Version 1.2.133 (2010-04-10)</h2> <h2>Version 1.2.133 (2010-04-10)</h2>
......
...@@ -131,8 +131,17 @@ public class ConnectionInfo implements Cloneable { ...@@ -131,8 +131,17 @@ public class ConnectionInfo implements Cloneable {
*/ */
public void setBaseDir(String dir) { public void setBaseDir(String dir) {
if (persistent) { if (persistent) {
if (!name.startsWith("~")) { String fileSystemPrefix = "";
name = dir + SysProperties.FILE_SEPARATOR + name; int colonIndex = name.lastIndexOf(':');
if (colonIndex != -1) {
// cut "split:" and similar things
fileSystemPrefix = name.substring(0, colonIndex+1);
name = name.substring(colonIndex+1);
}
if (name.startsWith("~")) {
name = fileSystemPrefix + name;
} else {
name = fileSystemPrefix + dir + SysProperties.FILE_SEPARATOR + name;
} }
} }
} }
......
...@@ -672,6 +672,16 @@ public class TestTools extends TestBase { ...@@ -672,6 +672,16 @@ public class TestTools extends TestBase {
} catch (SQLException e) { } catch (SQLException e) {
// ignore // ignore
} }
// Test filesystem prefix
deleteDb("testsplit");
server = Server.createTcpServer(
"-baseDir", baseDir,
"-tcpPort", "9192",
"-tcpAllowOthers").start();
conn = DriverManager.getConnection("jdbc:h2:tcp://localhost:9192/split:testsplit", "sa", "");
conn.close();
server.stop();
deleteDb("testsplit");
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论