- Notifications
You must be signed in to change notification settings - Fork35
Fix set_auto_conf with single quotes#153
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
dmitry-lipetsk commentedDec 3, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Postgres' functions for escaping and unescaping configuration property values. /** Strip the quotes surrounding the given string, and collapse any embedded* '' sequences and backslash escapes.*/char*DeescapeQuotedString(constchar*s) /* * Escape (by doubling) any single quotes or backslashes in given string **/char*escape_single_quotes_ascii(constchar*src) |
1b9a293
to2c26deb
Compare- we do not touch existing values- escaping of '\n', '\r', '\t', '\b' and '\\' is added- translation of bool into 'on|off' is addedtest_set_auto_conf is updated.
Uh oh!
There was an error while loading.Please reload this page.
Let's control a correct usage of this function.Plus one assert was added in _escape_config_value.
Ошибки flake8 |
dmitry-lipetsk commentedDec 3, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
flake8 error:
It is a really interesting problem. Flake does not like: Line 1637 inee7dc91
but doesn't mind it: Line 1644 inee7dc91
For me - it need to configure flake and disable E721. https://stackoverflow.com/questions/52395064/e721-do-not-compare-types-use-isinstance-error
What I do not use isinstance:
|
dmitry-lipetsk commentedDec 3, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
https://www.flake8rules.com/rules/E721.html
They are really thinking that know what I want :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This patch was tested with pg_probackup2 test system. All is OK.
5e9ecbc
intomasterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This patch improves an PostgresNode::set_auto_conf method
New implementation does the following things:
This patch closes a problem with storing a command line with quotes in postgres' configuration files.
A test is provided.
It is a temporary solution to exist problems. In the future we should work with configuration files a more cleverly: