Repository navigation
fix(jdbc): convert getBoolean through integer coercion - #62
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #54.
What changed
LibsqlResultSet.getBoolean(int)now delegates togetInt(int) != 0, matching xerial/sqlite-jdbc 3.53.4.0 (JDBC3ResultSet.java:180-182). The old custom truthiness (case-insensitive"true", direct REAL test, blob first-byte test) is gone. Javadoc on the method records the conversion for every storage class: NULL, INTEGER, REAL, TEXT, and BLOB.New behavior test
LibsqlResultSetGetBooleanTestcovers the storage-class matrix from the steering: text'true','0','2', REAL 0.5, REAL 2.0, blobx'313233', and NULL, and assertsgetBooleanequalsgetInt != 0for each. It also pins the corrected probe values for'true','2', and 0.5: false, true, false.Contract decision
Match xerial 3.53.4.0. Boolean conversion goes through integer coercion, so:
getIntgetBoolean'true''0''2'x'313233'This is the parity default from #54. TEXT and BLOB coercion comes from #31's numeric getters, so
getBooleanandgetIntagree everywhere.Evidence
Failing before the fix (current main at fca0f14):
Passing after the fix:
Full module suite after the fix:
./mvnw spotless:applyran clean before commit.Deviations
None.
Closes #32