Skip to content

Commit

Permalink
SQL: Return correct catalog separator in JDBC (elastic#33670)
Browse files Browse the repository at this point in the history
JDBC DatabaseMetadata returns correct separator (:) for catalog/cluster names.

Fix elastic#33654
  • Loading branch information
costin authored Sep 13, 2018
1 parent 53ba253 commit 60ab4f9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public boolean isCatalogAtStart() throws SQLException {

@Override
public String getCatalogSeparator() throws SQLException {
return ".";
return ":";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.sql.jdbc.jdbc;

import org.elasticsearch.test.ESTestCase;

public class JdbcDatabaseMetaDataTests extends ESTestCase {

private JdbcDatabaseMetaData md = new JdbcDatabaseMetaData(null);

public void testSeparators() throws Exception {
assertEquals(":", md.getCatalogSeparator());
assertEquals("\"", md.getIdentifierQuoteString());
assertEquals("\\", md.getSearchStringEscape());

}
}

0 comments on commit 60ab4f9

Please sign in to comment.