-
-
Notifications
You must be signed in to change notification settings - Fork 336
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
Change in Behavior - Bind Variable Detection w/o Space Before Minus #2510
Comments
OpinionI don't really thing that dashes should be allowed in bind variable names. Periods I get, but dashes add a lot of ambiguity because they are an operator. Should In my opinion, option 3 is the safest interpretation in SQL. |
I agree that allowing |
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).
This should be fixed with #2520 (and subsequently with the next release) |
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).
This should be fixed with 3.42.0. |
closing as fixed (and finally laid to rest in the upcoming 3.43.0) |
Observed in JDBI 3.41.3
Not observed in JDBI 3.38.2
Java 17
A query written as
select * from some_table where value = :bindVariable-7
results inorg.jdbi.v3.core.statement.UnableToCreateStatementException: Missing named parameter 'bindVariable-7' in binding
. It seems likely that changing the SQL to include a space between the bind variable name and the minus would correct this behavior, but it doesn't seem like that should be necessary.The text was updated successfully, but these errors were encountered: