-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Incorrect extraction of parameter placeholder positions #3467
Labels
Milestone
Comments
This must be irrelevant as of #4397. Please let us know if it still is. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug Report
Summary
SQLParserUtils::expandListParameters() and getPlaceholderPositions() fails to produce fragments when the quoted string
'[]'
appears in the query.Current behaviour
The named parameters are located before the problematic cut, but not after. Leaving a mix of positional and named parameters is rejected by the driver.
How to reproduce
Postgres-specific range functions receive a third parameter, describing the inclusiveness of the range.
SELECT daterange('2000-01-01', now(), '[]') AS x, :named_parameter AS y
It somehow matches as an opening of a bracket quoted text, cutting the rest of the statement from the fragment before locating named parameters.
The "bracket quoted text" regex fragment seems to be the latest addition (judging by the order of the constants and that it's the only private one), so I suspect it is too eager to parse such brackets inside other quoted literals.
I've briefly looked into the development of 3.0, but the proper SQL parsing facilities are not yet put into place to mitigate this (the methods in question are marked as deprecated though).
Workaround
Providing
'[]'
as a named parameter, such as:inclusive
, gets around the limitation.The text was updated successfully, but these errors were encountered: