-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Java] BigDecimal scale > precision bug fix #6110
Conversation
…al negative scale
I am running into an issue here now, where we run into an Allocator assertion, because something is not being cleaned up properly
I have traced it down to either one of the PreparedStatements used in the But after an hour I am giving up on debugging this for now, I'm getting nowhere still |
I had a look at the Java_org_duckdb_DuckDBNative_duckdb_1jdbc_1execute function and the return value caught my attention: This is freed with Java_org_duckdb_DuckDBNative_duckdb_1jdbc_1free_1result, but execute() is not calling it. |
I see what you mean, I thought the boolean value would indicate if freeing is necessary, looks like it's not. I think it's the responsibility of the caller to free the result of There are other examples similar to this test that do behave properly though |
I think I forgot to call free at least here:
And here it might be missing also, if multiple calls of execute happen:
|
👍 Thanks for your help, that was exactly it. |
@Mytherin could you re-run the python test? |
I will just merge it instead - I believe that changing the JDBC code has not broken the Python client :) Thanks! |
This PR fixes #6073
As the title says, in java BigDecimal can have a scale that is larger than its precision.
Since we map directly precision -> width this causes a problem internally because we assert that width >= scale.