-
-
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
getUnquotedStatementFragments breaks on ESCAPE '\' #3640
Comments
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Thank you for reporting this issue and creating the test case 👍 |
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This must have been fixed by #4397, no longer reproducible on SELECT "f".*
FROM "oc_filecache" "f"
WHERE
(
(
("f"."storage" = {:dcValue1}) AND ("f"."path" LIKE {:dcValue2} ESCAPE '\')
) OR (
("f"."storage" = {:dcValue3}) AND ("f"."path" LIKE {:dcValue4} ESCAPE '\')
) OR (
"f"."storage" = {:dcValue5}
)
) AND (
("f"."mimetype" <> {:dcValue6}) OR ("f"."size" = 0)
) AND (
"f"."path" NOT LIKE {:dcValue7}
) AND (
"f"."path" NOT LIKE {:dcValue8}
)
ORDER BY "f"."mtime"
DESC LIMIT 500 The curly braces identify what has been recognized as a parameter (see |
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. |
I encountered an issue where not all the parameters would be replaced correctly.
The query in question is:
Manually replacing all the values runs this like a charm.
However it seems the split in getUnquotedStatementFragments doesn't like ESCAPING on
\
.What happens is that
:dcValue1
and:dcValue2
are properly found.However then the regex interpets the
\'
as an escaped quote. Thus ignoring until the next escape statement.The replaces statement thus looks like
I'll try to dig a bit deeper or to come up with a PR that at least provides you with failing test cases to verify.
The text was updated successfully, but these errors were encountered: