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

Database URL: extra semicolons are not supported.

上级 5020df70
...@@ -242,6 +242,9 @@ public class ConnectionInfo implements Cloneable { ...@@ -242,6 +242,9 @@ public class ConnectionInfo implements Cloneable {
url = url.substring(0, idx); url = url.substring(0, idx);
String[] list = StringUtils.arraySplit(settings, ';', false); String[] list = StringUtils.arraySplit(settings, ';', false);
for (String setting : list) { for (String setting : list) {
if (setting.length() == 0) {
continue;
}
int equal = setting.indexOf('='); int equal = setting.indexOf('=');
if (equal < 0) { if (equal < 0) {
throw getFormatException(); throw getFormatException();
......
...@@ -38,6 +38,7 @@ public class TestCases extends TestBase { ...@@ -38,6 +38,7 @@ public class TestCases extends TestBase {
} }
public void test() throws Exception { public void test() throws Exception {
testExtraSemicolonInDatabaseURL();
testGroupSubquery(); testGroupSubquery();
testCountDistinctNotNull(); testCountDistinctNotNull();
testDependencies(); testDependencies();
...@@ -96,6 +97,14 @@ public class TestCases extends TestBase { ...@@ -96,6 +97,14 @@ public class TestCases extends TestBase {
deleteDb("cases"); deleteDb("cases");
} }
private void testExtraSemicolonInDatabaseURL() throws SQLException {
deleteDb("cases");
Connection conn = getConnection("cases;");
conn.close();
conn = getConnection("cases;;mode=mysql;");
conn.close();
}
private void testGroupSubquery() throws SQLException { private void testGroupSubquery() throws SQLException {
deleteDb("cases"); deleteDb("cases");
Connection conn = getConnection("cases"); Connection conn = getConnection("cases");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论