Repository navigation
fix: sql_variant rows read by their own type, no crash on a failed cell (#497); numeric strings keep a double's value (#498) - #499
Merged
Conversation
…ed cell (#497); numeric strings keep a double's value (#498) - d_variant dispatched on the column's definition and overwrote it with the first row's base type, so every later row was read as that type. It now dispatches each row on its own type, and stores a NULL from its first read (a second read of a NULL is SQL_NO_DATA). - a failed cell left a hole in the row that building the JS rows dereferenced (0xC0000005). A missing cell is now null, and a failed cell ends the fetch: the partial row is dropped and the query ends in an error, ours if the driver gave none. - bigint max read as a double came back as INT64_MIN: range bounds now exact as doubles. - under numeric strings a double is String(n)'s text ("1e-10"), not %f ("0.000000"). decimal and money still go through a double (#498 part 2, open). - corpus scripts issue-497 (+ -ns, agreed) and issue-498 (known-bug); the replay keeps whole rows for scripts; the recorder prints native bigints; unit tests for both. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Oct 24, 2026
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 #497. Partly fixes #498 (doubles only; decimal/money as text is still open, see below).
#497
d_variantwrote the first row's base type into the column definition, so every later row of asql_variantcolumn was read as that type. It now dispatches each row on its own type, and stores a NULL from its firstSQLGetData(a second read returnsSQL_NO_DATA, which lost the row).fromQueryResultdereferenced. A missing cell is now null, and a failed cell ends the fetch: the partial row is dropped and the query ends in an error. When the driver gives no diagnostic, the error is ours (HY000cannot read column N), so a failed read is never silent.#498 part 1: under numeric strings a double is
String(n)'s text ("1e-10","1.5e+300"), not%f("0.000000").Still open (owner's call):
decimal/money/smallmoneyare still read as a double, so digits beyond a double are lost; prepared statements bindnumericas a double. ReadingSQL_DECIMALas text fixes it, but the driver's text keeps the scale ("5.00") and has no leading zero (".0000001").Tests
issue-497,issue-497-ns(agreed: every base type first, followed by all the others, with numeric strings off and on) andissue-498(known-bug, pins what is still open). Before the fix,issue-497wasPROCESS FAILED 3221225477.params-complete-refactored.test.js.🤖 Generated with Claude Code