mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 04:12:19 +00:00
More accurate parsing for ALTER USER ... DROP ALL PROFILES/SETTINGS
This commit is contained in:
parent
296677b9ef
commit
e6f137e199
@ -386,13 +386,13 @@ bool ParserAlterSettingsProfileElements::parseImpl(Pos & pos, ASTPtr & node, Exp
|
||||
return false;
|
||||
}
|
||||
|
||||
if (action == "DROP" && target == "ALL PROFILES")
|
||||
if (action == "DROP" && target == "ALL PROFILES" && !drop_all_profiles)
|
||||
{
|
||||
drop_all_profiles = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (action == "DROP" && target == "ALL SETTINGS")
|
||||
if (action == "DROP" && target == "ALL SETTINGS" && !drop_all_settings)
|
||||
{
|
||||
drop_all_settings = true;
|
||||
return true;
|
||||
|
@ -19,3 +19,4 @@ CREATE SETTINGS PROFILE `test_profile` SETTINGS INHERIT `profile_b`, INHERIT `pr
|
||||
CREATE SETTINGS PROFILE `test_profile` SETTINGS INHERIT `profile_a`, INHERIT `profile_d`
|
||||
CREATE SETTINGS PROFILE `test_profile` SETTINGS INHERIT `profile_e`
|
||||
CREATE SETTINGS PROFILE `test_profile`
|
||||
OK
|
||||
|
@ -69,6 +69,8 @@ run_test user ${test_user}
|
||||
run_test role ${test_role}
|
||||
run_test profile ${test_profile}
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query="ALTER USER user1 DROP ALL PROFILES,,,,,,ADD PROFILE a" 2>&1 | grep -F -q 'Syntax error' && echo 'OK' || echo 'FAIL'
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "DROP PROFILE ${profile_a};"
|
||||
$CLICKHOUSE_CLIENT -q "DROP PROFILE ${profile_b};"
|
||||
$CLICKHOUSE_CLIENT -q "DROP PROFILE ${profile_c};"
|
||||
|
Loading…
Reference in New Issue
Block a user