From 7d64f4f3d5da94204f3b01696d0037cb563b926b Mon Sep 17 00:00:00 2001 From: pufit Date: Mon, 18 Nov 2024 13:59:24 -0800 Subject: [PATCH] fix conflicts --- src/Interpreters/Context.cpp | 4 ++-- src/Interpreters/Context.h | 4 ++-- src/Parsers/Access/ParserSettingsProfileElement.cpp | 4 ++-- src/Parsers/CommonParsers.h | 9 +++++++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/Interpreters/Context.cpp b/src/Interpreters/Context.cpp index d2aad0a52d8..6644d116a4b 100644 --- a/src/Interpreters/Context.cpp +++ b/src/Interpreters/Context.cpp @@ -2501,7 +2501,7 @@ void Context::applySettingsChanges(const SettingsChanges & changes) applySettingsChangesWithLock(changes, lock); } -void Context::checkSettingsConstraintsWithLock(const SettingsProfileElements & profile_elements, SettingSource source) +void Context::checkSettingsConstraintsWithLock(const AlterSettingsProfileElements & profile_elements, SettingSource source) { getSettingsConstraintsAndCurrentProfilesWithLock()->constraints.check(*settings, profile_elements, source); if (getApplicationType() == ApplicationType::LOCAL || getApplicationType() == ApplicationType::SERVER) @@ -2541,7 +2541,7 @@ void Context::checkMergeTreeSettingsConstraintsWithLock(const MergeTreeSettings getSettingsConstraintsAndCurrentProfilesWithLock()->constraints.check(merge_tree_settings, changes); } -void Context::checkSettingsConstraints(const SettingsProfileElements & profile_elements, SettingSource source) +void Context::checkSettingsConstraints(const AlterSettingsProfileElements & profile_elements, SettingSource source) { SharedLockGuard lock(mutex); checkSettingsConstraintsWithLock(profile_elements, source); diff --git a/src/Interpreters/Context.h b/src/Interpreters/Context.h index e567d963ef9..d659322ae72 100644 --- a/src/Interpreters/Context.h +++ b/src/Interpreters/Context.h @@ -864,7 +864,7 @@ public: void applySettingsChanges(const SettingsChanges & changes); /// Checks the constraints. - void checkSettingsConstraints(const SettingsProfileElements & profile_elements, SettingSource source); + void checkSettingsConstraints(const AlterSettingsProfileElements & profile_elements, SettingSource source); void checkSettingsConstraints(const SettingChange & change, SettingSource source); void checkSettingsConstraints(const SettingsChanges & changes, SettingSource source); void checkSettingsConstraints(SettingsChanges & changes, SettingSource source); @@ -1410,7 +1410,7 @@ private: void setCurrentDatabaseWithLock(const String & name, const std::lock_guard & lock); - void checkSettingsConstraintsWithLock(const SettingsProfileElements & profile_elements, SettingSource source); + void checkSettingsConstraintsWithLock(const AlterSettingsProfileElements & profile_elements, SettingSource source); void checkSettingsConstraintsWithLock(const SettingChange & change, SettingSource source); diff --git a/src/Parsers/Access/ParserSettingsProfileElement.cpp b/src/Parsers/Access/ParserSettingsProfileElement.cpp index 965f7e5ccf6..b63192fc4ae 100644 --- a/src/Parsers/Access/ParserSettingsProfileElement.cpp +++ b/src/Parsers/Access/ParserSettingsProfileElement.cpp @@ -334,9 +334,9 @@ bool ParserAlterSettingsProfileElements::parseImpl(Pos & pos, ASTPtr & node, Exp submode = "ALL PROFILES"; else if (ParserKeyword{Keyword::ALL_SETTINGS}.ignore(pos, expected)) submode = "ALL SETTINGS"; - else if (ParserKeyword{Keyword::PROFILES}.ignore(pos, expected) || ParserKeyword{"PROFILE"}.ignore(pos, expected)) + else if (ParserKeyword{Keyword::PROFILES}.ignore(pos, expected) || ParserKeyword{Keyword::PROFILE}.ignore(pos, expected)) submode = "PROFILES"; - else if (ParserKeyword{Keyword::SETTINGS}.ignore(pos, expected) || ParserKeyword{"SETTING"}.ignore(pos, expected)) + else if (ParserKeyword{Keyword::SETTINGS}.ignore(pos, expected) || ParserKeyword{Keyword::SETTING}.ignore(pos, expected)) submode = "SETTINGS"; } diff --git a/src/Parsers/CommonParsers.h b/src/Parsers/CommonParsers.h index c02f8d06323..d1818e4a8cf 100644 --- a/src/Parsers/CommonParsers.h +++ b/src/Parsers/CommonParsers.h @@ -10,22 +10,25 @@ namespace DB { #define APPLY_FOR_PARSER_KEYWORDS(MR_MACROS) \ + MR_MACROS(ADD, "ADD") \ MR_MACROS(ADD_COLUMN, "ADD COLUMN") \ MR_MACROS(ADD_CONSTRAINT, "ADD CONSTRAINT") \ MR_MACROS(ADD_INDEX, "ADD INDEX") \ MR_MACROS(ADD_PROJECTION, "ADD PROJECTION") \ MR_MACROS(ADD_STATISTICS, "ADD STATISTICS") \ - MR_MACROS(ADD, "ADD") \ MR_MACROS(ADMIN_OPTION_FOR, "ADMIN OPTION FOR") \ MR_MACROS(AFTER, "AFTER") \ MR_MACROS(ALGORITHM, "ALGORITHM") \ MR_MACROS(ALIAS, "ALIAS") \ MR_MACROS(ALL, "ALL") \ + MR_MACROS(ALL_PROFILES, "ALL_PROFILES") \ + MR_MACROS(ALL_SETTINGS, "ALL SETTINGS") \ MR_MACROS(ALTER_COLUMN, "ALTER COLUMN") \ MR_MACROS(ALTER_DATABASE, "ALTER DATABASE") \ MR_MACROS(ALTER_LIVE_VIEW, "ALTER LIVE VIEW") \ MR_MACROS(ALTER_POLICY, "ALTER POLICY") \ MR_MACROS(ALTER_PROFILE, "ALTER PROFILE") \ + MR_MACROS(ALTER_PROFILES, "ALTER PROFILES") \ MR_MACROS(ALTER_QUOTA, "ALTER QUOTA") \ MR_MACROS(ALTER_ROLE, "ALTER ROLE") \ MR_MACROS(ALTER_ROW_POLICY, "ALTER ROW POLICY") \ @@ -379,6 +382,7 @@ namespace DB MR_MACROS(PRIMARY_KEY, "PRIMARY KEY") \ MR_MACROS(PRIMARY, "PRIMARY") \ MR_MACROS(PROFILE, "PROFILE") \ + MR_MACROS(PROFILES, "PROFILES") \ MR_MACROS(PROJECTION, "PROJECTION") \ MR_MACROS(PROTOBUF, "Protobuf") \ MR_MACROS(PULL, "PULL") \ @@ -443,7 +447,8 @@ namespace DB MR_MACROS(SET_ROLE_DEFAULT, "SET ROLE DEFAULT") \ MR_MACROS(SET_ROLE, "SET ROLE") \ MR_MACROS(SET_TRANSACTION_SNAPSHOT, "SET TRANSACTION SNAPSHOT") \ - MR_MACROS(SET, "SET") \ + MR_MACROS(SET, "SET") \ + MR_MACROS(SETTING, "SETTING") \ MR_MACROS(SETTINGS, "SETTINGS") \ MR_MACROS(SHOW_ACCESS, "SHOW ACCESS") \ MR_MACROS(SHOW_CREATE, "SHOW CREATE") \