Repository navigation
Zero the fetch indicator arrays - #412
Merged
Merged
Conversation
MariaDB Connector/ODBC leaves the length/indicator of a non-NULL BIT value unwritten in a columnar fetch. The indicator array was allocated uninitialized, so whenever its memory held -1 (SQL_NULL_DATA) from earlier use, a stored true/false read back as missing. This was the intermittent ODBC.load round-trip failure in CI (Senior read as [true, true, false, missing]). Zeroed indicators read a value the driver didn't mark as non-NULL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #412 +/- ##
==========================================
+ Coverage 83.58% 83.60% +0.01%
==========================================
Files 7 7
Lines 987 988 +1
==========================================
+ Hits 825 826 +1
Misses 162 162 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A 1000-row read makes the indicator array a malloc-sized block; freeing blocks of that size filled with -1 before each read makes the unfixed code read them on Julia 1.10 and 1.12 inside the full suite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
quinnj
referenced
this pull request
Oct 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A
BITcolumn read with the default columnar fetch sometimes came back asmissingeven though the database storedtrue/false. This is the intermittent CI failure in theODBC.loadround trip (Seniorread as[true, true, false, missing]on main in run 35814057011, and as[1, 1, missing, missing]on #410's first run today).Cause: MariaDB Connector/ODBC leaves the length/indicator of a non-NULL
BITvalue unwritten in a columnar (block) fetch; it writesSQL_NULL_DATAfor NULLs and lengths for other fixed-size types. The indicator array was allocated withundef, so whenever its memory still held-1(SQL_NULL_DATA) from earlier use, the value read asmissing. Pre-filling the array with a sentinel shows the BIT column's non-NULL slots untouched after the fetch, whileINT/TINYINTslots get 4 and 1. Row-wise reads (iterate_rows=true) were not affected.The fetch indicator arrays are now zero-initialized, so a value the driver didn't mark as NULL is read as a value.
Verification:
ODBC.load+ read round trips read all-missingwhileSELECT Senior IS NULLon the server returned 0 for every row.BIT(1)column 20 times, each after freeing blocks filled with-1of the indicator array's size. Inside the full suite on main it fails on Julia 1.12 and 1.10 (all or most values read asmissing); with the fix the fullPkg.test()passes on both, against MariaDB with the MariaDB_Connector_ODBC_jll driver.🤖 Generated with Claude Code