Skip to content

fix(csharp): return true from AdbcDataReader.IsDBNull for null values - #4920

Merged
CurtHagenlocher merged 1 commit into
apache:mainfrom
CurtHagenlocher:fix-isdbnull
Oct 18, 2026
Merged

CurtHagenlocher merged 1 commit into
apache:mainfrom
CurtHagenlocher:fix-isdbnull

Conversation

@CurtHagenlocher

Copy link
Copy Markdown
Contributor

What's changed

AdbcDataReader.IsDBNull checked GetValue(ordinal) == null, but GetValue returns DBNull.Value for null values, so IsDBNull always returned false. It now checks for DBNull.

It still goes through GetValue, so a value supplied by an OnGetValue handler continues to count as not null.

Found while working on #4919.

Tests

TestIsDBNull reads a column whose fourth row is null and checks IsDBNull for every row.

🤖 Generated with Claude Code

GetValue returns DBNull.Value for null values, but IsDBNull compared its
result to null, so it always returned false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CurtHagenlocher
CurtHagenlocher merged commit 23e04c4 into apache:main Oct 18, 2026
9 checks passed
@CurtHagenlocher
CurtHagenlocher deleted the fix-isdbnull branch October 18, 2026 17:24
@lidavidm lidavidm added this to the ADBC Libraries 25 milestone Oct 20, 2026
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.

2 participants