mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Backport #71332 to 24.10: Fix inconsistent AST formatting when granting wrong wildcard grants (#71393)
Co-authored-by: robot-clickhouse <robot-clickhouse@users.noreply.github.com>
This commit is contained in:
parent
254bdc9d0a
commit
22727423a0
@ -113,6 +113,7 @@ GRANT SELECT ON db*.* TO john -- correct
|
|||||||
GRANT SELECT ON *.my_table TO john -- wrong
|
GRANT SELECT ON *.my_table TO john -- wrong
|
||||||
GRANT SELECT ON foo*bar TO john -- wrong
|
GRANT SELECT ON foo*bar TO john -- wrong
|
||||||
GRANT SELECT ON *suffix TO john -- wrong
|
GRANT SELECT ON *suffix TO john -- wrong
|
||||||
|
GRANT SELECT(foo) ON db.table* TO john -- wrong
|
||||||
```
|
```
|
||||||
|
|
||||||
## Privileges
|
## Privileges
|
||||||
|
@ -155,6 +155,9 @@ namespace
|
|||||||
|
|
||||||
for (auto & [access_flags, columns] : access_and_columns)
|
for (auto & [access_flags, columns] : access_and_columns)
|
||||||
{
|
{
|
||||||
|
if (wildcard && !columns.empty())
|
||||||
|
return false;
|
||||||
|
|
||||||
AccessRightsElement element;
|
AccessRightsElement element;
|
||||||
element.access_flags = access_flags;
|
element.access_flags = access_flags;
|
||||||
element.columns = std::move(columns);
|
element.columns = std::move(columns);
|
||||||
|
@ -19,4 +19,6 @@ REVOKE SELECT ON team*.* FROM user_03141;
|
|||||||
SHOW GRANTS FOR user_03141;
|
SHOW GRANTS FOR user_03141;
|
||||||
SELECT '---';
|
SELECT '---';
|
||||||
|
|
||||||
|
GRANT SELECT(bar) ON foo.test* TO user_03141; -- { clientError SYNTAX_ERROR }
|
||||||
|
|
||||||
DROP USER user_03141;
|
DROP USER user_03141;
|
||||||
|
Loading…
Reference in New Issue
Block a user