Avoid using backslash in SQL string literals#7669
Open
Green-Chan wants to merge 1 commit intocitusdata:mainfrom
Open
Avoid using backslash in SQL string literals#7669Green-Chan wants to merge 1 commit intocitusdata:mainfrom
Green-Chan wants to merge 1 commit intocitusdata:mainfrom
Conversation
Contributor
Author
Contributor
Author
|
I haven't touched string literals in tests because citus is not tested with |
Green-Chan
commented
Aug 9, 2024
| int32 coordinatorId = GetLocalGroupId(); | ||
|
|
||
| appendStringInfo(command, "SELECT gid FROM pg_prepared_xacts " | ||
| "WHERE gid LIKE 'citus\\_%d\\_%%' and database = current_database()", |
Contributor
Author
There was a problem hiding this comment.
Any idea why %% is used here? Wouldn't % do the same? We could fix it while we are here
Contributor
There was a problem hiding this comment.
it's printf() for a single %.
a31f24e to
eead8cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If parameter
standard_conforming_stringsis off, backslashes in ordinary string literals ('...') are treated as escape characters causing problems. In particularCREATE EXTENSION citus;is failing whenstandard_conforming_strings=off:This PR eliminates usages of backslashes in SQL string literals, therefore allowing using Citus when
standard_conforming_strings=off.