Skip to content

fix(rust/core): Handle the ASCII characters from sqlstate instead of their decimal values - #4141

Merged
felipecrv merged 1 commit into
apache:mainfrom
felipecrv:sqlstate-chars
May 31, 2026
Merged

fix(rust/core): Handle the ASCII characters from sqlstate instead of their decimal values#4141
felipecrv merged 1 commit into
apache:mainfrom
felipecrv:sqlstate-chars

Conversation

@felipecrv

Copy link
Copy Markdown
Contributor

No description provided.

@felipecrv
felipecrv requested a review from wjones127 as a code owner March 24, 2026 23:14
@felipecrv
felipecrv requested a review from lidavidm March 24, 2026 23:15
@felipecrv

Copy link
Copy Markdown
Contributor Author

I'm tired of seeing sqlstate: [48, 48, 48, 48, 48], all the time. :)

Comment thread rust/core/src/error.rs
} else if c >= 32 && c <= 126 {
char::from(c as u8)
} else {
'\u{FFFD}'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we can still display the value somehow instead of hiding it? (Just stringify the integer value instead?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not hiding. I'm showing � to say "this is not valid UTF-8". SQLSTATE is ASCII/UTF-8. A C implementation of this wouldn't even bother validating the value. Would just be printing it from a char *.

Comment thread rust/core/src/error.rs
Comment thread rust/core/src/error.rs
@lidavidm

Copy link
Copy Markdown
Member

@felipecrv sorry for losing track of this. Do you want to rebase and fix the Clippy lint and then we can get this merged? I'll give in to your reasoning here ^_^

@felipecrv

Copy link
Copy Markdown
Contributor Author

Rebased. cargo fmt'd and pushed.

@felipecrv
felipecrv merged commit 16ff4d4 into apache:main May 31, 2026
19 checks passed
@felipecrv
felipecrv deleted the sqlstate-chars branch May 31, 2026 14:30
@lidavidm lidavidm added this to the ADBC Libraries 24 milestone Jul 22, 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