Skip to content

Zero the fetch indicator arrays - #412

Merged
quinnj merged 2 commits into
mainfrom
claude/zero-fetch-indicators
Oct 27, 2026
Merged

quinnj merged 2 commits into
mainfrom
claude/zero-fetch-indicators

Conversation

@quinnj

@quinnj quinnj commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

A BIT column read with the default columnar fetch sometimes came back as missing even though the database stored true/false. This is the intermittent CI failure in the ODBC.load round trip (Senior read 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 BIT value unwritten in a columnar (block) fetch; it writes SQL_NULL_DATA for NULLs and lengths for other fixed-size types. The indicator array was allocated with undef, so whenever its memory still held -1 (SQL_NULL_DATA) from earlier use, the value read as missing. Pre-filling the array with a sentinel shows the BIT column's non-NULL slots untouched after the fetch, while INT/TINYINT slots 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:

  • Local repro on main: 56 of 300 ODBC.load + read round trips read all-missing while SELECT Senior IS NULL on the server returned 0 for every row.
  • New test: reads a 1000-row BIT(1) column 20 times, each after freeing blocks filled with -1 of 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 as missing); with the fix the full Pkg.test() passes on both, against MariaDB with the MariaDB_Connector_ODBC_jll driver.
  • The test depends on the allocator reusing freed memory, so it can't be fully deterministic, but it failed on every unfixed run I tried.

🤖 Generated with Claude Code

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

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.60%. Comparing base (93865fb) to head (3573aaf).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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
quinnj merged commit fb9fced into main Oct 27, 2026
7 checks passed
@quinnj
quinnj deleted the claude/zero-fetch-indicators branch October 27, 2026 10:11
quinnj referenced this pull request Oct 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant