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 regression for #2481 #2499

Merged
merged 1 commit into from Oct 2, 2023
Merged

Fix regression for #2481 #2499

merged 1 commit into from Oct 2, 2023

Conversation

hgschmie
Copy link
Contributor

@hgschmie hgschmie commented Oct 1, 2023

A regression was highlighted that the change in 3.41.2 swallowed -
characters at the end of named parameters and break expressions such
as :foo->>'stuff'.

  • Rework the grammar to not support - as the last character.
  • Align the HashStatementLexer to the ColonStatementLexer
  • Add tests

This addresses #2481 (comment)

A regression was highlighted that the change in 3.41.2 swallowed `-`
characters at the end of named parameters and break expressions such
as `:foo->>'stuff'`.

- Rework the grammar to not support `-` as the last character.
- Align the HashStatementLexer to the ColonStatementLexer
- Add tests

This addresses jdbi#2481 (comment)
@sonarcloud
Copy link

sonarcloud bot commented Oct 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@hgschmie hgschmie merged commit 44e01ef into jdbi:master Oct 2, 2023
42 checks passed
@hgschmie hgschmie deleted the regression-2481 branch October 2, 2023 05:16
hgschmie added a commit to hgschmie/jdbi that referenced this pull request Oct 24, 2023
This hopefully addresses all the issues raised in jdbi#2481, jdbi#2499 and finally jdbi#2510.

The case of the trailing '-' is not solvable without a trailing
delimiter. There is not enough information to decide whether
`:foo-bar` is "identifier 'foo-bar'" or "identifier 'foo' minus bar".

This PR drops the '-' again as a valid character in a parameter or
binding (sorry if you added it; but then again this was only added in
3.41.1). The dot (`.`) is still supported as a valid character in a
binding or parameter name. It always was for the parameters but not
for a binding (this caused the original jdbi#2481 issue).
hgschmie added a commit to hgschmie/jdbi that referenced this pull request Nov 19, 2023
This hopefully addresses all the issues raised in jdbi#2481, jdbi#2499 and finally jdbi#2510.

The case of the trailing '-' is not solvable without a trailing
delimiter. There is not enough information to decide whether
`:foo-bar` is "identifier 'foo-bar'" or "identifier 'foo' minus bar".

This PR drops the '-' again as a valid character in a parameter or
binding (sorry if you added it; but then again this was only added in
3.41.1). The dot (`.`) is still supported as a valid character in a
binding or parameter name. It always was for the parameters but not
for a binding (this caused the original jdbi#2481 issue).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants