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
Dollar quoting ($$) and single quoting (') errors when populating PostgreSQL dumps #2185
Comments
Thanks. Looks like you deeply discovered this issue. Could you send PR for it? |
Fix Codeception#2185 The old code handled dollar-quoted blocks only if the $$ is at the beginning of a new line. This enhancement detects it anywhere and also detects if the $$ is part of a SQL standard string and ignores it.
@DavertMik, done for branch 2.0 for the case when $$ is not at the beginning of the line. Please notice that the tagged dollar quoting (e.g. I suggest adding these two points as known issues and limitations until if/when they are implemented. |
@DavertMik could you please review this commit? The testing errors seem irrelevant. |
Fix #2185 when $$ not at line start ONLY
Fix Codeception/Codeception#2185 The old code handled dollar-quoted blocks only if the $$ is at the beginning of a new line. This enhancement detects it anywhere and also detects if the $$ is part of a SQL standard string and ignores it.
The error
Syntax error: 7 ERROR: unterminated dollar-quoted string at or near "$$
(reported in #1128) that was fixed in #1450 seems did not account for all cases. It works when the dollar quoting is at the beginning of the line like this:but produces the mentioned error when the same code above is written like below, which is generated by
pg_dump
and is a valid syntax as shown in the examples at CREATE FUNCTION:Also it does not work at all with the following quoting variations:
$BODY$
.I tested that on version 2.0.16 but by looking into the code of version 2.1.1, it seems it's valid there too.
The text was updated successfully, but these errors were encountered: