-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
Escaping change in 3.30.0 breaks existing queries #2084
Comments
I don't think there's any perfect fix here, but if SQL standard escaping is sufficient, we'd want something like
This handles standard doubled-up quote escapes and allows for newlines within strings (which seem to be allowed by most dbs) but does not handle backslash-escaped quotes, which the previous implementation allowed and which many dbs accept. I don't see any use case at all for the arbitrary escaping added in #2034. |
Sorry this got broken :( Having this parsing code is a real drag. Will try to find some time to get a better fix in. |
No worries. I was able to work around it easily using a custom |
I reverted the change in question for now, since it caused regressions. Still TBD on what the path forward is. |
Change was backed out in 3.33.0 |
#2034 changes template rendering for all queries that contain escape sequences in quoted strings and make it impossible to include a single backslash in a quoted string. Prior to this change the only escape sequence that was treated as an escape within quotes was
\'
. After this change, backslash escapes within quoted strings apply to anything that is not a backslash.This can break queries in unexpected ways when using a DB that supports backslash escapes in quoted strings. For example, in MySQL,
SELECT 'a\t\b\nc'
results inThis query works exactly as expected prior to 3.30. However, in 3.30.0, the query is rendered as
SELECT 'atbnc'
, which gives a completely different result.In fact, there's no (obvious) way to get the same query after this change.
select 'a\\tb\\nc'
renders asselect 'a\\tb\\nc'
(since\\
is not treated as an escape of a backslash (seefragment ESCAPE_IN_QUOTE
)), which results ina\tb\nc
.The text was updated successfully, but these errors were encountered: