yiming187 closed pull request #61: Fix for KYLIN-2668
URL: https://github.com/apache/kylin/pull/61

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinConnection.java 
index 6852998961..61d13b9abd 100644
--- a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinConnection.java
+++ b/jdbc/src/main/java/org/apache/kylin/jdbc/KylinConnection.java
@@ -51,7 +51,7 @@ protected KylinConnection(UnregisteredDriver driver, 
KylinJdbcFactory factory, S
         super(driver, factory, url, info);
         String odbcUrl = url;
-        odbcUrl = odbcUrl.replace(Driver.CONNECT_STRING_PREFIX + "//", "");
+        odbcUrl = odbcUrl.replaceAll((Driver.CONNECT_STRING_PREFIX + 
"[[A-Za-z0-9]*=[A-Za-z0-9]*;]*//").toString(), "");
         String[] temps = odbcUrl.split("/");
         assert temps.length == 2;
diff --git a/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java 
index 08876349cb..255cb76bee 100644
--- a/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java
+++ b/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java
@@ -189,6 +189,14 @@ public void testPreparedStatementWithCubeData() throws 
SQLException {
+     @Test
+    public void testSSLFromURL() throws SQLException{
+        Driver driver = new DummyDriver();
+        Connection conn = 
driver.connect("jdbc:kylin:ssl=True;//test_url/test_db", null);
+        assertEquals("test_url", ((KylinConnection)conn).getBaseUrl());
+        assertEquals("test_db", ((KylinConnection)conn).getProject());
+    }        
     private void printResultSet(ResultSet rs) throws SQLException {
         ResultSetMetaData meta = rs.getMetaData();


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

Reply via email to