matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.77k stars 274 forks source link

[Question]: can not show grants for role? #17634

Open shawn0915 opened 2 months ago

shawn0915 commented 2 months ago

Describe your problem

when I using mo cloud, and create/grant role, but can not show the grants.

(admin) [(none)] 11:45:08> create role r1;
Query OK, 0 rows affected (0.21 sec)

(admin) [(none)] 11:45:27> grant all on table *.* to r1;
Query OK, 0 rows affected (0.06 sec)

(admin) [(none)] 11:45:31> show grants for r1;
Empty set (0.08 sec)

图片

shawn0915 commented 2 months ago

跟语法说明不匹配 https://docs.matrixorigin.cn/1.1.3/MatrixOne/Reference/SQL-Reference/Other/SHOW-Statements/show-grants/#_1 > SHOW GRANTS FOR {username[@hostname] | rolename};

为什么要加 show grants for ROLE 才能显示呢

(admin) [(none)] 11:58:10> show grants for role r1;
+-----------------------------------+
| Grants for r1                     |
+-----------------------------------+
| GRANT table all ON table *.* `r1` |
+-----------------------------------+
1 row in set (0.20 sec)

(admin) [(none)] 11:58:13> GRANT table all ON table *.* `r1`;
ERROR 1064 (HY000): SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 11 near " table all ON table *.* `r1`";
(admin) [(none)] 11:59:25>