mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Fix parsing list of roles in commands CREATE USER, CREATE ROW POLICY, CREATE QUOTA.
This commit is contained in:
parent
71bb3fc46d
commit
b7f0129505
@ -63,7 +63,7 @@ void updateQuotaFromQueryImpl(Quota & quota, const ASTCreateQuotaQuery & query,
|
|||||||
|
|
||||||
const GenericRoleSet * roles = nullptr;
|
const GenericRoleSet * roles = nullptr;
|
||||||
std::optional<GenericRoleSet> temp_role_set;
|
std::optional<GenericRoleSet> temp_role_set;
|
||||||
if (roles)
|
if (roles_from_query)
|
||||||
roles = &*roles_from_query;
|
roles = &*roles_from_query;
|
||||||
else if (query.roles)
|
else if (query.roles)
|
||||||
roles = &temp_role_set.emplace(*query.roles);
|
roles = &temp_role_set.emplace(*query.roles);
|
||||||
|
@ -50,7 +50,7 @@ namespace
|
|||||||
|
|
||||||
const GenericRoleSet * roles = nullptr;
|
const GenericRoleSet * roles = nullptr;
|
||||||
std::optional<GenericRoleSet> temp_role_set;
|
std::optional<GenericRoleSet> temp_role_set;
|
||||||
if (roles)
|
if (roles_from_query)
|
||||||
roles = &*roles_from_query;
|
roles = &*roles_from_query;
|
||||||
else if (query.roles)
|
else if (query.roles)
|
||||||
roles = &temp_role_set.emplace(*query.roles);
|
roles = &temp_role_set.emplace(*query.roles);
|
||||||
|
@ -35,7 +35,7 @@ namespace
|
|||||||
|
|
||||||
const GenericRoleSet * default_roles = nullptr;
|
const GenericRoleSet * default_roles = nullptr;
|
||||||
std::optional<GenericRoleSet> temp_role_set;
|
std::optional<GenericRoleSet> temp_role_set;
|
||||||
if (default_roles)
|
if (default_roles_from_query)
|
||||||
default_roles = &*default_roles_from_query;
|
default_roles = &*default_roles_from_query;
|
||||||
else if (query.default_roles)
|
else if (query.default_roles)
|
||||||
default_roles = &temp_role_set.emplace(*query.default_roles);
|
default_roles = &temp_role_set.emplace(*query.default_roles);
|
||||||
|
@ -340,6 +340,7 @@ bool ParserCreateUserQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expec
|
|||||||
query->hosts = std::move(hosts);
|
query->hosts = std::move(hosts);
|
||||||
query->add_hosts = std::move(add_hosts);
|
query->add_hosts = std::move(add_hosts);
|
||||||
query->remove_hosts = std::move(remove_hosts);
|
query->remove_hosts = std::move(remove_hosts);
|
||||||
|
query->default_roles = std::move(default_roles);
|
||||||
query->profile = std::move(profile);
|
query->profile = std::move(profile);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user