Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ upgrading. These changes do not affect metadata on All-Purpose Clusters.
- Fixed `?` characters inside SQL comments, string literals, and quoted identifiers being incorrectly counted as parameter placeholders when `supportManyParameters=1`. `SQLInterpolator` now uses `SqlCommentParser` to locate only real placeholders. Fixes #1331.
- Fixed `MetadataOperationTimeout` not being applied when metadata operations use SHOW commands. Operations like `getTables`, `getSchemas`, and `getColumns` now respect the `MetadataOperationTimeout` connection property instead of hanging indefinitely with no timeout.
- Reclassify transient server errors to standard SQL states (08S01, 40001) across all Thrift error sites. This ensures UC unavailability and concurrent modification errors surface consistently for better retry handling. Note: Dashboards and branching logic keyed on legacy XXUCC or 42000 must be updated.
- Fixed `setCatalog()` and `setSchema()` producing invalid SQL (e.g. `SET CATALOG ``name``) when the catalog or schema name was passed already wrapped in backticks. Backticks are now stripped before wrapping, and `getCatalog()`/`getSchema()` return the bare identifier name.
- Fixed telemetry HTTP client socket leak that prevented CRaC checkpoint. After `Connection.close()`, delayed telemetry flush tasks could re-create HTTP clients that were never closed, leaking TCP sockets. Fixes #1325.
- Fixed client-side enforcement of `maxRows` limit. When `statement.setMaxRows()` is set, `ResultSet.next()` now returns false once the row limit is reached, even if the server returns more rows. Applies to all result types (Thrift, SEA, inline, CloudFetch).
- Bump shaded `bouncycastle` (`bcprov-jdk18on`, `bcpkix-jdk18on`) from 1.79 to 1.84 to address [CVE-2026-5598](https://github.com/advisories/GHSA-p93r-85wp-75v3) (covert timing channel, severity 8.9) and two related MEDIUM CVEs (GHSA-wg6q-6289-32hp, GHSA-c3fc-8qff-9hwx). All three are unsurfaced by NVD-CPE scanners but visible to GHSA-backed scanners like OSV.
- Bump shaded `libthrift` from 0.19.0 to 0.23.0 to clear the May 2026 Apache Thrift advisory batch (GHSA-7pwc-h2j2-rjgj covering CVE-2026-41603/41604/41605/43869). The libthrift 0.21 release changed `ProcessFunction`'s generic signatures, which required regenerating the project's checked-in Thrift-generated Java sources with the matching compiler.

---
*Note: When making changes, please add your change under the appropriate section
with a brief description.*
with a brief description.*
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,9 @@ public void setCatalog(String catalog) throws SQLException {
return;
}
Statement statement = this.createStatement();
statement.execute("SET CATALOG `" + catalog + "`");
this.session.setCatalog(catalog);
String cleanCatalog = stripBackticks(catalog);
statement.execute("SET CATALOG `" + cleanCatalog + "`");
this.session.setCatalog(cleanCatalog);
}

@Override
Expand Down Expand Up @@ -865,8 +866,9 @@ public Struct createStruct(String typeName, Object[] attributes) throws SQLExcep
@Override
public void setSchema(String schema) throws SQLException {
Statement statement = this.createStatement();
statement.execute("USE SCHEMA `" + schema + "`");
session.setSchema(schema);
String cleanSchema = stripBackticks(schema);
statement.execute("USE SCHEMA `" + cleanSchema + "`");
session.setSchema(cleanSchema);
}

@Override
Expand Down Expand Up @@ -1090,4 +1092,14 @@ private void closeStatementSafely(Statement statement) {
}
}
}

private static String stripBackticks(String identifier) {
if (identifier != null
&& identifier.startsWith("`")
&& identifier.endsWith("`")
&& identifier.length() >= 2) {
return identifier.substring(1, identifier.length() - 1);
}
return identifier;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,60 @@ public void testGetAndSetSchemaAndCatalog() throws SQLException {
assertEquals(connection.getSchema(), DEFAULT_SCHEMA);
}

@Test
public void testSetCatalogAndSchemaWithPreWrappedBackticks() throws SQLException {
when(databricksClient.createSession(
new Warehouse(WAREHOUSE_ID), CATALOG, SCHEMA, new HashMap<>()))
.thenReturn(IMMUTABLE_SESSION_INFO);
connection = new DatabricksConnection(connectionContext, databricksClient);
connection.open();

String backtickWrappedCatalog = "`catalog-with-hyphen`";
when(databricksClient.executeStatement(
eq("SET CATALOG `catalog-with-hyphen`"),
eq(new Warehouse(WAREHOUSE_ID)),
eq(new HashMap<>()),
eq(StatementType.SQL),
any(),
any(),
any()))
.thenReturn(resultSet);
connection.setCatalog(backtickWrappedCatalog);
assertEquals(connection.getCatalog(), "catalog-with-hyphen");

String backtickWrappedSchema = "`schema-with-hyphen`";
when(databricksClient.executeStatement(
eq("USE SCHEMA `schema-with-hyphen`"),
eq(new Warehouse(WAREHOUSE_ID)),
eq(new HashMap<>()),
eq(StatementType.SQL),
any(),
any(),
any()))
.thenReturn(resultSet);
connection.setSchema(backtickWrappedSchema);
assertEquals(connection.getSchema(), "schema-with-hyphen");

verify(databricksClient)
.executeStatement(
eq("SET CATALOG `catalog-with-hyphen`"),
eq(new Warehouse(WAREHOUSE_ID)),
eq(new HashMap<>()),
eq(StatementType.SQL),
any(),
any(),
any());
verify(databricksClient)
.executeStatement(
eq("USE SCHEMA `schema-with-hyphen`"),
eq(new Warehouse(WAREHOUSE_ID)),
eq(new HashMap<>()),
eq(StatementType.SQL),
any(),
any(),
any());
}

@Test
public void testSetCatalogAndSchemaWithHyphenatedIdentifiers() throws SQLException {
when(databricksClient.createSession(
Expand Down