This commit is contained in:
kssenii 2023-02-14 19:39:21 +01:00
parent 7beb843650
commit 33572f9acd
3 changed files with 6 additions and 7 deletions

View File

@ -52,8 +52,10 @@ struct AccessRightsElement
bool sameDatabaseAndTable(const AccessRightsElement & other) const
{
return (database == other.database) && (any_database == other.any_database) && (table == other.table)
&& (any_table == other.any_table);
return (database == other.database) && (any_database == other.any_database)
&& (table == other.table) && (any_table == other.any_table)
&& (named_collection == other.named_collection) && (any_named_collection == other.any_named_collection)
&& (isNamedCollectionAccess() == other.isNamedCollectionAccess());
}
bool sameOptions(const AccessRightsElement & other) const

View File

@ -77,9 +77,7 @@ namespace
if (i != elements.size() - 1)
{
const auto & next_element = elements[i + 1];
if ((element.database == next_element.database) && (element.any_database == next_element.any_database)
&& (element.table == next_element.table) && (element.any_table == next_element.any_table)
&& (element.named_collection == next_element.named_collection))
if (element.sameDatabaseAndTable(next_element))
next_element_on_same_db_and_table = true;
}

View File

@ -136,8 +136,7 @@ namespace
if (!ParserKeyword{"ON"}.ignore(pos, expected))
return false;
const bool grant_named_collection_access = named_collection_access && named_collection_access == access_and_columns.size();
if (grant_named_collection_access)
if (named_collection_access && named_collection_access == access_and_columns.size())
{
ASTPtr collection;
if (ParserToken{TokenType::Asterisk}.ignore(pos, expected))