Repository navigation
refactor(jdbc): extract SqliteRealText from LibsqlResultSet - #216
Merged
Merged
Conversation
Characterization tests for the four unpinned behaviors in the JDBC refactor Wave 0: - attached-schema table metadata through pragma_database_list - date/time text tails (offset, Z, bare time) and BLOB rejection - duplicate savepoint names and releasing the outermost savepoint of an auto-commit-started transaction - executeBatch racing statement close Tests only; no production code, pom or dependency change.
Owner
Author
|
Root verdict: PASS at 9ee30e6. Verifier proved the 258-line block moved byte-identically, with only The Xerial Control lane failed in |
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.
Fixes #198
Pure move, zero behavior change. Extracts the SQLite REAL text formatter from
LibsqlResultSetinto a package-privateSqliteRealTextwith a package-privatestatic String format(double).Base note: this PR targets
test/i195-pin-jdbc-behaviors, the parent stack link (wave 0 characterization tests, 9 new tests). It is not based onmain.Diff stat
Proof the moved lines are unchanged
Old
LibsqlResultSet.javalines 187–444 (258 lines) vsSqliteRealText.javalines 14–271 — the only differing line is the entry-method signature, which the issue requires renaming and widening to package-private:Everything else — the two explanatory comments, the four power tables (
FP_POWERS_OF_TEN,FP_POWER_SCALES,FP_POWER_SCALE_LOW, plusFP_POWER_SCALE_HIGH),roundTripsTo,fpPowerOfTenToTwo,fpPowerOfTwoToTen,fpPowerOfTen,fpNormalizeHigh,fpMultiplyWide,fpMultiplyHigh, andfpUnsigned— is identical text, at identical indentation, with method names, constants, comments, and arithmetic byte for byte. NoBigDecimal.toPlainString,Double.toString,String.format, or%g.The only other edit in
LibsqlResultSetis removing the now-unusedjava.math.BigIntegerimport (its only use lived in the moved code;BigDecimalis still used).Call sites repointed:
getString(was 181, now 180):case Value.Float f -> SqliteRealText.format(f.value());getBytes(was 641, now 381):case Value.Float f -> SqliteRealText.format(f.value()).getBytes(...);Behavior preserved: negative zero renders
0.0, exponents render signed and zero padded to two digits, NaN rendersNaN, and fixed notation applies when the decimal exponent is between -4 and 16.Line counts
LibsqlResultSet.javaSqliteRealText.javaLanes
No test file, dependency, or
pom.xmlchange. No public surface change. Nothing else inLibsqlResultSetmoved or renamed.