Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JDBC type for DECIMAL columns; add test #6

Merged
merged 1 commit into from
May 13, 2024

Conversation

elefeint
Copy link
Contributor

This PR allows DECIMAL(W,S) types to be interpreted as DECIMAL JDBC type. Currently the type is returned as a generic JAVA_OBJECT because DECIMAL(W,S) does not match DECIMAL` in the case statement. This is similar to 0.9.2 behavior except the start-of-string matching is done in SQL rather than Java.

I wonder if a better fix would be to use data_type_id from duckdb_columns() rather than data_type from information_schema.columns? It would require adding hardcoded duckdb type numbers into DuckDBColumnType. The test is useful either way.

There is a tiny unrelated improvement to Assertions utility, allowing the calling code to add a prefix to indicate which one of the loop iterations failed.

Fixes duckdb/duckdb#11365

@Mause Mause merged commit 4f62ac7 into duckdb:main May 13, 2024
6 checks passed
@Mause
Copy link
Member

Mause commented May 13, 2024

Thanks!

@elefeint elefeint deleted the fix_decimal_column_metadata branch May 13, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[JDBC] DatabaseMetadata.getColumns returns the wrong type for DECIMAL columns
2 participants