Skip to content

Pass TEXT values containing embedded NULs to UDFs intact - #730

Merged
flavorjones merged 1 commit into
mainfrom
card-320-text-nul-truncation
Aug 11, 2026
Merged

Pass TEXT values containing embedded NULs to UDFs intact#730
flavorjones merged 1 commit into
mainfrom
card-320-text-nul-truncation

Conversation

@flavorjones

Copy link
Copy Markdown
Member

TEXT values containing an embedded NUL byte were stored whole, but functions created with Database#define_function received them truncated at the first NUL, so any validation or content-policy decision the function made ran on only a prefix of the stored value.

sqlite3val2rb now builds the Ruby string with the explicit byte length reported by sqlite, matching the BLOB branch, so function blocks receive the complete value.

TEXT values containing an embedded NUL byte were stored whole, but
functions created with `Database#define_function` received them
truncated at the first NUL, so any validation or content-policy
decision the function made ran on only a prefix of the stored value.

`sqlite3val2rb` will now build the Ruby string with the explicit byte
length reported by sqlite, matching the BLOB branch, so function
blocks will receive the complete value.
@flavorjones
flavorjones merged commit 2677f9a into main Aug 11, 2026
135 checks passed
@flavorjones
flavorjones deleted the card-320-text-nul-truncation branch August 11, 2026 19:40
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