mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
fix more tests and clang tidy build
This commit is contained in:
parent
35524d0175
commit
62541ab764
@ -50,11 +50,14 @@ void SettingsProfileElement::init(const ASTSettingsProfileElement & ast, const A
|
|||||||
{
|
{
|
||||||
setting_name = ast.setting_name;
|
setting_name = ast.setting_name;
|
||||||
|
|
||||||
/// Optionally check if a setting with that name is allowed.
|
|
||||||
if (access_control)
|
if (access_control)
|
||||||
{
|
{
|
||||||
|
/// Check if a setting with that name is allowed.
|
||||||
if (setting_name != ALLOW_BACKUP_SETTING_NAME)
|
if (setting_name != ALLOW_BACKUP_SETTING_NAME)
|
||||||
access_control->checkSettingNameIsAllowed(setting_name);
|
access_control->checkSettingNameIsAllowed(setting_name);
|
||||||
|
/// Check if a CHANGEABLE_IN_READONLY is allowed.
|
||||||
|
if (ast.type == SettingConstraintType::CHANGEABLE_IN_READONLY && !access_control->doesSettingsConstraintsReplacePrevious())
|
||||||
|
throw Exception("CHANGEABLE_IN_READONLY for " + setting_name + " is not allowed unless settings_constraints_replace_previous is enabled", ErrorCodes::NOT_IMPLEMENTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
value = ast.value;
|
value = ast.value;
|
||||||
@ -62,9 +65,6 @@ void SettingsProfileElement::init(const ASTSettingsProfileElement & ast, const A
|
|||||||
max_value = ast.max_value;
|
max_value = ast.max_value;
|
||||||
type = ast.type;
|
type = ast.type;
|
||||||
|
|
||||||
if (type == SettingConstraintType::CHANGEABLE_IN_READONLY && !access_control->doesSettingsConstraintsReplacePrevious())
|
|
||||||
throw Exception("CHANGEABLE_IN_READONLY for " + setting_name + " is not allowed unless settings_constraints_replace_previous is enabled", ErrorCodes::NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
if (!value.isNull())
|
if (!value.isNull())
|
||||||
value = Settings::castValueUtil(setting_name, value);
|
value = Settings::castValueUtil(setting_name, value);
|
||||||
if (!min_value.isNull())
|
if (!min_value.isNull())
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Core/Field.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
{
|
{
|
||||||
|
@ -102,6 +102,7 @@ def test_smoke():
|
|||||||
110000000,
|
110000000,
|
||||||
"\\N",
|
"\\N",
|
||||||
"\\N",
|
"\\N",
|
||||||
|
"\\N",
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -148,7 +149,7 @@ def test_smoke():
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
assert system_settings_profile_elements(user_name="robin") == [
|
assert system_settings_profile_elements(user_name="robin") == [
|
||||||
["\\N", "robin", "\\N", 0, "\\N", "\\N", "\\N", "\\N", "\\N", "xyz"]
|
["\\N", "robin", "\\N", 0, "\\N", "\\N", "\\N", "\\N", "\\N", "\\N", "xyz"]
|
||||||
]
|
]
|
||||||
|
|
||||||
instance.query("ALTER USER robin SETTINGS NONE")
|
instance.query("ALTER USER robin SETTINGS NONE")
|
||||||
@ -215,11 +216,12 @@ def test_settings_from_granted_role():
|
|||||||
110000000,
|
110000000,
|
||||||
"\\N",
|
"\\N",
|
||||||
"\\N",
|
"\\N",
|
||||||
|
"\\N",
|
||||||
],
|
],
|
||||||
["xyz", "\\N", "\\N", 1, "max_ast_depth", 2000, "\\N", "\\N", "\\N", "\\N"],
|
["xyz", "\\N", "\\N", 1, "max_ast_depth", 2000, "\\N", "\\N", "\\N", "\\N", "\\N"],
|
||||||
]
|
]
|
||||||
assert system_settings_profile_elements(role_name="worker") == [
|
assert system_settings_profile_elements(role_name="worker") == [
|
||||||
["\\N", "\\N", "worker", 0, "\\N", "\\N", "\\N", "\\N", "\\N", "xyz"]
|
["\\N", "\\N", "worker", 0, "\\N", "\\N", "\\N", "\\N", "\\N", "\\N", "xyz"]
|
||||||
]
|
]
|
||||||
|
|
||||||
instance.query("REVOKE worker FROM robin")
|
instance.query("REVOKE worker FROM robin")
|
||||||
@ -315,13 +317,13 @@ def test_inheritance():
|
|||||||
["xyz", "local directory", 1, 0, "[]", "[]"]
|
["xyz", "local directory", 1, 0, "[]", "[]"]
|
||||||
]
|
]
|
||||||
assert system_settings_profile_elements(profile_name="xyz") == [
|
assert system_settings_profile_elements(profile_name="xyz") == [
|
||||||
["xyz", "\\N", "\\N", 0, "max_memory_usage", 100000002, "\\N", "\\N", 1, "\\N"]
|
["xyz", "\\N", "\\N", 0, "max_memory_usage", 100000002, "\\N", "\\N", 1, "\\N", "\\N"]
|
||||||
]
|
]
|
||||||
assert system_settings_profile("alpha") == [
|
assert system_settings_profile("alpha") == [
|
||||||
["alpha", "local directory", 1, 0, "['robin']", "[]"]
|
["alpha", "local directory", 1, 0, "['robin']", "[]"]
|
||||||
]
|
]
|
||||||
assert system_settings_profile_elements(profile_name="alpha") == [
|
assert system_settings_profile_elements(profile_name="alpha") == [
|
||||||
["alpha", "\\N", "\\N", 0, "\\N", "\\N", "\\N", "\\N", "\\N", "xyz"]
|
["alpha", "\\N", "\\N", 0, "\\N", "\\N", "\\N", "\\N", "\\N", "\\N", "xyz"]
|
||||||
]
|
]
|
||||||
assert system_settings_profile_elements(user_name="robin") == []
|
assert system_settings_profile_elements(user_name="robin") == []
|
||||||
|
|
||||||
|
@ -109,9 +109,9 @@ u2_01292 local directory no_password {} [] [] [] ['%.%.myhost.com'] 0 [] []
|
|||||||
u3_01292 local directory sha256_password {} ['192.169.1.1','192.168.0.0/16'] ['localhost'] [] [] 0 ['r1_01292'] []
|
u3_01292 local directory sha256_password {} ['192.169.1.1','192.168.0.0/16'] ['localhost'] [] [] 0 ['r1_01292'] []
|
||||||
u4_01292 local directory double_sha1_password {} ['::/0'] [] [] [] 1 [] ['r1_01292']
|
u4_01292 local directory double_sha1_password {} ['::/0'] [] [] [] 1 [] ['r1_01292']
|
||||||
-- system.settings_profile_elements
|
-- system.settings_profile_elements
|
||||||
\N u1_01292 \N 0 readonly 1 \N \N \N \N
|
\N u1_01292 \N 0 readonly 1 \N \N \N \N \N
|
||||||
\N u2_01292 \N 0 \N \N \N \N \N default
|
\N u2_01292 \N 0 \N \N \N \N \N \N default
|
||||||
\N u3_01292 \N 0 max_memory_usage 5000000 4000000 6000000 0 \N
|
\N u3_01292 \N 0 max_memory_usage 5000000 4000000 6000000 0 \N \N
|
||||||
\N u4_01292 \N 0 \N \N \N \N \N default
|
\N u4_01292 \N 0 \N \N \N \N \N \N default
|
||||||
\N u4_01292 \N 1 max_memory_usage 5000000 \N \N \N \N
|
\N u4_01292 \N 1 max_memory_usage 5000000 \N \N \N \N \N
|
||||||
\N u4_01292 \N 2 readonly 1 \N \N \N \N
|
\N u4_01292 \N 2 readonly 1 \N \N \N \N \N
|
||||||
|
Loading…
Reference in New Issue
Block a user