Skip to content

db.sqlite: fix get_text to trim data after (including) first 0 character - #25040

Merged
spytheman merged 1 commit into
vlang:masterfrom
D4MI4NX:master
Aug 5, 2025
Merged

spytheman merged 1 commit into
vlang:masterfrom
D4MI4NX:master

Conversation

@D4MI4NX

@D4MI4NX D4MI4NX commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

When using SQLite and selecting a text column, C.strlen is used to calculate the string's length. Due to C.strlen stopping at the first 0 character, data can get cut off. This PR modifies the get_text function to use C.sqlite3_column_bytes instead of C.strlen to calculate the strings length, preserving the entire data.

@huly-for-github

Copy link
Copy Markdown

Connected to Hulyยฎ: V_0.6-23557

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent find. Thank you ๐Ÿ™‡๐Ÿปโ€โ™‚๏ธ .

@spytheman
spytheman merged commit 13ba08f into vlang:master Aug 5, 2025
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