Skip to content
Merged
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
2 changes: 2 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- Updated bundled Jackson, lz4-java, Netty, and Apache HttpComponents Client and Core dependencies to patched versions to address security findings.

### Fixed
- Fixed `DatabaseMetaData.getTypeInfo()` returning the `INTERVAL` row out of `DATA_TYPE` order.

- Fixed later logging-enabled connections being unable to produce logs when an earlier connection
used `LogLevel=OFF`. The first enabled connection now establishes the shared JUL handler, while a
later `OFF` connection does not disable it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,26 @@ public class MetadataResultSetBuilder {
null,
null
},
{
"INTERVAL",
Types.VARCHAR,
40,
"'",
"'",
"Qualifier",
typeNullable,
false,
typeSearchable,
null,
false,
null,
"INTERVAL",
0,
6,
Types.VARCHAR,
null,
null
},
{
"BOOLEAN",
Types.BOOLEAN,
Expand Down Expand Up @@ -423,26 +443,6 @@ public class MetadataResultSetBuilder {
Types.TIMESTAMP,
3,
null
},
{
"INTERVAL",
Types.VARCHAR,
40,
"'",
"'",
"Qualifier",
typeNullable,
false,
typeSearchable,
null,
false,
null,
"INTERVAL",
0,
6,
Types.VARCHAR,
null,
null
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ void tearDown() {
DatabricksThreadContextHolder.clearAllContext();
}

@Test
void testTypeInfoRowsAreOrderedByDataType() throws SQLException {
List<Integer> actualDataTypes = new ArrayList<>();
try (DatabricksResultSet resultSet = metadataResultSetBuilder.getTypeInfoResult()) {
while (resultSet.next()) {
actualDataTypes.add(resultSet.getInt("DATA_TYPE"));
}
}

assertFalse(actualDataTypes.isEmpty(), "TYPE_INFO should contain at least one row");
List<Integer> sortedDataTypes = new ArrayList<>(actualDataTypes);
sortedDataTypes.sort(Integer::compareTo);
assertEquals(
sortedDataTypes,
actualDataTypes,
"TYPE_INFO rows should be ordered by DATA_TYPE as required by DatabaseMetaData");
}

@Test
void testThriftNativeFormattingMatchesRawThriftBuilder() throws SQLException {
assertNativeFormattingMatchesThrift(
Expand Down
Loading