Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(postgres): prefer parsing non-localized notice severity field #745

Merged
merged 1 commit into from
Oct 19, 2020

Conversation

dstoeckel
Copy link

In order to support PostgreSQL <= 9.5, the b'S' field of an error/notice
message was parsed. However, this field can be localized and thus parsing
can fail for instances that use a non-english locale. In version > 9.5,
the b'V' field, that is guaranteed to be in english, was added. However,
even for these versions parsing would fail as the b'S' field was also
parsed. This patch prefers b'V' over b'S' if it exists and uses a default
severity in case b'V' is not present and b'S' could not be parsed.

Fixes #734

@dstoeckel
Copy link
Author

Hmm, the macOS CI failure seems unrelated to my changes as other pull requests seem to have them, too.

@abonander
Copy link
Collaborator

I thought I disabled that build last night. Try rebasing?

@abonander
Copy link
Collaborator

Ah nope, one last thing to comment out.

In order to support PostgreSQL <= 9.5, the b'S' field of an error/notice
message was parsed. However, this field can be localized and thus parsing
can fail for instances that use a non-english locale. In version > 9.5,
the b'V' field, that is guaranteed to be in english, was added. However,
even for these versions parsing would fail as the b'S' field was also
parsed. This patch prefers b'V' over b'S' if it exists and uses a default
severity in case b'V' is not present and b'S' could not be parsed.

Fixes launchbadge#734
@dstoeckel
Copy link
Author

I have rebased to the current master. Seems like all tests pass without problems now.

@abonander
Copy link
Collaborator

Excellent, thanks!

@abonander abonander merged commit 144dcce into launchbadge:master Oct 19, 2020
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.

Problem parsing error severity for localized postgres instances
2 participants