mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Make IAST::FormatSettings more regular
This commit is contained in:
parent
7a0de384d4
commit
35a4fabc2d
@ -170,7 +170,9 @@ size_t IAST::checkDepthImpl(size_t max_depth) const
|
||||
String IAST::formatWithPossiblyHidingSensitiveData(size_t max_length, bool one_line, bool show_secrets) const
|
||||
{
|
||||
WriteBufferFromOwnString buf;
|
||||
format({buf, one_line, show_secrets});
|
||||
FormatSettings settings(buf, one_line);
|
||||
settings.show_secrets = show_secrets;
|
||||
format(settings);
|
||||
return wipeSensitiveDataAndCutToLength(buf.str(), max_length);
|
||||
}
|
||||
|
||||
|
@ -198,10 +198,9 @@ public:
|
||||
bool show_secrets = true; /// Show secret parts of the AST (e.g. passwords, encryption keys).
|
||||
char nl_or_ws; /// Newline or whitespace.
|
||||
|
||||
FormatSettings(WriteBuffer & ostr_, bool one_line_, bool show_secrets_ = true)
|
||||
FormatSettings(WriteBuffer & ostr_, bool one_line_)
|
||||
: ostr(ostr_)
|
||||
, one_line(one_line_)
|
||||
, show_secrets(show_secrets_)
|
||||
{
|
||||
nl_or_ws = one_line ? ' ' : '\n';
|
||||
}
|
||||
|
@ -6,9 +6,9 @@ namespace DB
|
||||
|
||||
void formatAST(const IAST & ast, WriteBuffer & buf, bool hilite, bool one_line, bool show_secrets)
|
||||
{
|
||||
IAST::FormatSettings settings(buf, one_line, show_secrets);
|
||||
IAST::FormatSettings settings(buf, one_line);
|
||||
settings.hilite = hilite;
|
||||
|
||||
settings.show_secrets = show_secrets;
|
||||
ast.format(settings);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user