Skip to content

Commit e36acdb

Browse files
committed
SQL: Return correct catalog separator in JDBC (#33670)
JDBC DatabaseMetadata returns correct separator (:) for catalog/cluster names. Fix #33654 (cherry picked from commit c922f72)
1 parent 6a69aae commit e36acdb

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcDatabaseMetaData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public boolean isCatalogAtStart() throws SQLException {
368368

369369
@Override
370370
public String getCatalogSeparator() throws SQLException {
371-
return ".";
371+
return ":";
372372
}
373373

374374
@Override
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
package org.elasticsearch.xpack.sql.jdbc.jdbc;
8+
9+
import org.elasticsearch.test.ESTestCase;
10+
11+
public class JdbcDatabaseMetaDataTests extends ESTestCase {
12+
13+
private JdbcDatabaseMetaData md = new JdbcDatabaseMetaData(null);
14+
15+
public void testSeparators() throws Exception {
16+
assertEquals(":", md.getCatalogSeparator());
17+
assertEquals("\"", md.getIdentifierQuoteString());
18+
assertEquals("\\", md.getSearchStringEscape());
19+
20+
}
21+
}

0 commit comments

Comments
 (0)