Repository navigation
fix(jdbc): make getColumnClassName follow the current row - #66
Merged
Merged
Conversation
Closes #36. Part of #54. getColumnClassName now reads the value at the metadata cursor, the same runtime accessor #35 introduced, instead of scanning every row for a column-wide class. Empty results and positions after the last row report java.lang.Object; a valid row reports the current storage class, with integers outside the int range reporting java.lang.Long. Before the first next() the cursor is the preloaded first row, matching xerial 3.53.4.0 JDBC3ResultSet.getColumnClassName.
magnusp
force-pushed
the
fix/36-column-classname
branch
from
October 21, 2026 22:34
af34f44 to
d0bad84
Compare
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.
Closes #36. Part of #54.
What changed
LibsqlResultSetMetaData.getColumnClassNamenow reads the value at the metadata cursor through the sharedLibsqlResultSet.valueForMetadataaccessor added by getColumnType ignores runtime storage class #35, instead of scanning every row for a column-wide class.java.lang.Integer, INTEGER outside it isjava.lang.Long, FLOAT isjava.lang.Double, TEXT isjava.lang.String, and BLOB/NULL arejava.lang.Object.java.lang.Object.integerClassNameandisIntInRangehelpers.select 1 union all select 'a') before cursor movement, on each row, and after the last row, plus a current-row Integer-to-Long range check.Contract decision
Class metadata is cursor-local, matching xerial 3.53.4.0
JDBC3ResultSet.getColumnClassName(JDBC3ResultSet.java:579-597). Empty results and end-of-results reportjava.lang.Object; otherwise the class describes the value on the current row. Parity wins under #54.One Steering detail does not match the pinned xerial behavior. Steering says positions before the first row report
java.lang.Object. I probed xerial 3.53.4.0 directly: it preloads the first row during execute, so before the firstnext()it reports that row's class (Integer/Stringin a newly executed result set), notObject. The vendoredRSMetaDataTest.testGetColumnClassNameasserts that preloaded behavior, so returningObjectbefore the first row would break the conformance suite. This PR therefore follows the actual pinned xerial behavior, which is the primary contract, and keeps conformance green.Evidence
Failing before the fix:
Passing after the fix:
The conformance run includes the vendored xerial
RSMetaDataTest(13 tests, all passed), confirming the before-first-row and mixed-column behavior against live sqld.Deviations
None from xerial 3.53.4.0. The literal Steering sentence about
Objectbefore the first row is not what the pinned xerial does; see Contract decision. Following it would regress the vendored conformance test, so the PR keeps actual xerial parity instead.