Skip to content

Preserve SQL NULL in implicit text conversions - #612

Merged
SRombauts merged 3 commits into
masterfrom
521-fix-null-text-conversion
Oct 24, 2026
Merged

SRombauts merged 3 commits into
masterfrom
521-fix-null-text-conversion

Conversation

@SRombauts

Copy link
Copy Markdown
Owner

Return nullptr when converting a SQL NULL Column implicitly to const char*, fixing nullable pointer fields populated by getColumns(). Keep getText()'s empty-string default and cover NULL, empty, and nonempty text. This intentional 4.0 behavior change fixes #521.

Return nullptr for implicit text-pointer conversions, including
getColumns() mappings, while retaining getText()'s safe empty-string
default. Test NULL, empty, and nonempty text values.
SRombauts added a commit that referenced this pull request Oct 24, 2026
Document the intentional 4.0 behavior change in PR #612.
@coveralls

coveralls commented Oct 24, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 99.735%. remained the same — 521-fix-null-text-conversion into master

@SRombauts
SRombauts force-pushed the 521-fix-null-text-conversion branch from 99b1b56 to 3135369 Compare October 24, 2026 14:17
Cover string and string-view conversions alongside nullable text
pointers. Clarify invalidation and allocation-failure behavior.
Point users relying on the old implicit empty-string fallback to
getText(), which retains that behavior.
@SRombauts
SRombauts force-pushed the 521-fix-null-text-conversion branch from 3135369 to be385a0 Compare October 24, 2026 14:32
@SRombauts
SRombauts merged commit 855e8fb into master Oct 24, 2026
72 checks passed
@SRombauts SRombauts self-assigned this Oct 24, 2026
@SRombauts
SRombauts deleted the 521-fix-null-text-conversion branch October 24, 2026 16:22
SRombauts added a commit that referenced this pull request Oct 24, 2026
Follow up on #612: guard nullable `const char*` values in README output,
correct the example's `getText(nullptr)` equivalence, and document
borrowed pointer/view lifetimes in `getColumns()`. Documentation and
examples only; no library behavior changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getColumns() does not allow reading null values

2 participants