diff --git a/jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaData.java b/jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaData.java index 7e3182169..27554bcaa 100644 --- a/jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaData.java +++ b/jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaData.java @@ -852,7 +852,6 @@ public ResultSet getColumns(String catalog, String schemaPattern, String tableNa "'NO' as IS_GENERATEDCOLUMN " + " FROM system.columns" + " WHERE database LIKE '" + (schemaPattern == null ? "%" : schemaPattern) + "'" + - " AND database LIKE '" + (catalog == null ? "%" : catalog) + "'" + " AND table LIKE '" + (tableNamePattern == null ? "%" : tableNamePattern) + "'" + " AND name LIKE '" + (columnNamePattern == null ? "%" : columnNamePattern) + "'" + " ORDER BY TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION"; diff --git a/jdbc-v2/src/test/java/com/clickhouse/jdbc/JdbcIntegrationTest.java b/jdbc-v2/src/test/java/com/clickhouse/jdbc/JdbcIntegrationTest.java index bbd2954ce..a709aaae9 100644 --- a/jdbc-v2/src/test/java/com/clickhouse/jdbc/JdbcIntegrationTest.java +++ b/jdbc-v2/src/test/java/com/clickhouse/jdbc/JdbcIntegrationTest.java @@ -39,9 +39,7 @@ public Connection getJdbcConnection(Properties properties) throws SQLException { info.putAll(properties); } - if (isCloud()) { - info.setProperty(ClientConfigProperties.DATABASE.getKey(), ClickHouseServerForTest.getDatabase()); - } + info.setProperty(ClientConfigProperties.DATABASE.getKey(), ClickHouseServerForTest.getDatabase()); return new ConnectionImpl(getEndpointString(), info); //return DriverManager.getConnection(getEndpointString(), "default", ClickHouseServerForTest.getPassword()); diff --git a/jdbc-v2/src/test/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataTest.java b/jdbc-v2/src/test/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataTest.java index 153c0ed88..d4599d83a 100644 --- a/jdbc-v2/src/test/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataTest.java +++ b/jdbc-v2/src/test/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataTest.java @@ -54,7 +54,7 @@ public void testGetColumns() throws Exception { conn.createStatement().execute(createTableStmt.toString()); DatabaseMetaData dbmd = conn.getMetaData(); - ResultSet rs = dbmd.getColumns(ClickHouseServerForTest.getDatabase(), null, tableName, null); + ResultSet rs = dbmd.getColumns(null, ClickHouseServerForTest.getDatabase(), tableName, null); int count = 0; while (rs.next()) { @@ -194,8 +194,9 @@ public void testGetTableTypes() throws Exception { } } - @Test(groups = { "integration" }) + @Test(groups = { "integration" }, enabled = false) public void testGetColumnsWithEmptyCatalog() throws Exception { + // test not relevant until catalogs are implemented try (Connection conn = getJdbcConnection()) { DatabaseMetaData dbmd = conn.getMetaData(); ResultSet rs = dbmd.getColumns("", null, "numbers", null);