-
Notifications
You must be signed in to change notification settings - Fork 35
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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(const char *s) /*
* Escape (by doubling) any single quotes or backslashes in given string
*
*/
char* escape_single_quotes_ascii(const char *src) |
1b9a293
to
2c26deb
Compare
- we do not touch existing values - escaping of '\n', '\r', '\t', '\b' and '\\' is added - translation of bool into 'on|off' is added test_set_auto_conf is updated.
Let's control a correct usage of this function. Plus one assert was added in _escape_config_value.
Ошибки flake8 |
flake8 error:
It is a really interesting problem. Flake does not like: Line 1637 in ee7dc91
but doesn't mind it: Line 1644 in ee7dc91
For me - it need to configure flake and disable E721.
What I do not use isinstance:
|
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.
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: