Fix style.

This commit is contained in:
Vitaly Baranov 2022-11-14 19:28:19 +01:00
parent 2e242fa991
commit ce81166c7e
8 changed files with 15 additions and 15 deletions

View File

@ -2,8 +2,8 @@
#include <Backups/BackupSettings.h>
#include <Core/SettingsFields.h>
#include <Parsers/ASTBackupQuery.h>
#include <Parsers/ASTSetQuery.h>
#include <Parsers/ASTFunction.h>
#include <Parsers/ASTSetQuery.h>
#include <Parsers/ASTLiteral.h>
#include <IO/ReadHelpers.h>

View File

@ -10,8 +10,8 @@ bool KnownObjectNames::exists(const String & name) const
std::lock_guard lock{mutex};
if (names.contains(name))
return true;
if (case_insensitive_names.empty())
if (!case_insensitive_names.empty())
{
String lower_name = Poco::toLower(name);
if (case_insensitive_names.contains(lower_name))

View File

@ -71,6 +71,6 @@ public:
/// Wipes sensitive data and cuts to a specified maximum length in one function call.
/// If the maximum length is zero then the function doesn't cut to the maximum length.
std::string wipeSensitiveDataAndCutToLength(const std::string & str, size_t max_length = 0);
std::string wipeSensitiveDataAndCutToLength(const std::string & str, size_t max_length);
}

View File

@ -445,8 +445,8 @@ void FormatFactory::registerInputFormat(const String & name, InputCreator input_
if (target)
throw Exception("FormatFactory: Input format " + name + " is already registered", ErrorCodes::LOGICAL_ERROR);
target = std::move(input_creator);
KnownFormatNames::instance().add(name);
registerFileExtension(name, name);
KnownFormatNames::instance().add(name);
}
void FormatFactory::registerNonTrivialPrefixAndSuffixChecker(const String & name, NonTrivialPrefixAndSuffixChecker non_trivial_prefix_and_suffix_checker)
@ -455,7 +455,6 @@ void FormatFactory::registerNonTrivialPrefixAndSuffixChecker(const String & name
if (target)
throw Exception("FormatFactory: Non trivial prefix and suffix checker " + name + " is already registered", ErrorCodes::LOGICAL_ERROR);
target = std::move(non_trivial_prefix_and_suffix_checker);
KnownFormatNames::instance().add(name);
}
void FormatFactory::registerAppendSupportChecker(const String & name, AppendSupportChecker append_support_checker)
@ -486,6 +485,7 @@ void FormatFactory::registerOutputFormat(const String & name, OutputCreator outp
throw Exception("FormatFactory: Output format " + name + " is already registered", ErrorCodes::LOGICAL_ERROR);
target = std::move(output_creator);
registerFileExtension(name, name);
KnownFormatNames::instance().add(name);
}
void FormatFactory::registerFileExtension(const String & extension, const String & format_name)

View File

@ -641,12 +641,6 @@ void ASTFunction::formatImplWithoutAlias(const FormatSettings & settings, Format
if (arguments->children[i]->as<ASTSetQuery>())
settings.ostr << "SETTINGS ";
if ((i == 1) && special_hilite_regexp
&& highlightStringLiteralWithMetacharacters(arguments->children[i], settings, "|()^$.[]?*+{:-"))
{
continue;
}
if (!settings.show_secrets && (secret_arguments.first <= i) && (i < secret_arguments.second))
{
settings.ostr << "'[HIDDEN]'";
@ -655,6 +649,12 @@ void ASTFunction::formatImplWithoutAlias(const FormatSettings & settings, Format
continue;
}
if ((i == 1) && special_hilite_regexp
&& highlightStringLiteralWithMetacharacters(arguments->children[i], settings, "|()^$.[]?*+{:-"))
{
continue;
}
arguments->children[i]->formatImpl(settings, state, nested_dont_need_parens);
}
}

View File

@ -42,7 +42,7 @@ public:
/// do not print empty parentheses if there are no args - compatibility with new AST for data types and engine names.
bool no_empty_args = false;
/// Kind of this function-like expression, how it's actually used.
/// Specifies where this function-like expression is used.
enum class Kind
{
ORDINARY_FUNCTION,

View File

@ -29,7 +29,7 @@ public:
ASTPtr clone() const override;
void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;
bool hasSecretParts() const override;
void updateTreeHashImpl(SipHash & hash_state) const override;

View File

@ -210,7 +210,7 @@ namespace
{
if (!ParserIdentifierWithOptionalParameters{}.parse(pos, backup_name, expected))
return false;
backup_name->as<ASTFunction &>().kind = ASTFunction::Kind::BACKUP_NAME;
return true;
}