SQL: Return correct catalog separator in JDBC (#33670)

JDBC DatabaseMetadata returns correct separator (:) for catalog/cluster names.

Fix #33654
This commit is contained in:
Costin Leau 2018-09-13 21:55:44 +03:00 committed by GitHub
parent 53ba253aa4
commit 60ab4f97ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View File

@ -368,7 +368,7 @@ class JdbcDatabaseMetaData implements DatabaseMetaData, JdbcWrapper {
@Override
public String getCatalogSeparator() throws SQLException {
return ".";
return ":";
}
@Override

View File

@ -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());
}
}