Skip to content

Commit

Permalink
Fix parsing empty connection parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Dec 19, 2019
1 parent e6f92c6 commit d013889
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public interface Patterns {

Pattern TC_PARAM_MATCHING_PATTERN = Pattern.compile(TC_PARAM_NAME_PATTERN + "=([^\\?&]+)");

Pattern QUERY_PARAM_MATCHING_PATTERN = Pattern.compile("([^\\?&=]+)=([^\\?&]+)");
Pattern QUERY_PARAM_MATCHING_PATTERN = Pattern.compile("([^\\?&=]+)=([^\\?&]*)");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ public void testConnectionUrl2() {

}

@Test
public void testEmptyQueryParameter() {
ConnectionUrl url = ConnectionUrl.newInstance("jdbc:tc:mysql://somehostname/databasename?key=");
assertEquals("'key' property value", "", url.getQueryParameters().get("key"));
}

@Test
public void testTmpfsOption() {
String urlString = "jdbc:tc:mysql://somehostname/databasename?TC_TMPFS=key:value,key1:value1";
Expand Down

0 comments on commit d013889

Please sign in to comment.