【 TiDB 使用环境】Poc
【 TiDB 版本】 7.1
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【附件:截图/日志/监控】
正常来说,一个普通用户只能查看到自己有权限查看的库表,
比如 用户 u2
mysql> show create user u2;
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| CREATE USER for u2@% |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| CREATE USER 'u2'@'%' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT ATTRIBUTE '{"comment": "u2c"}' |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.17 sec)
mysql> SELECT User, JSON_EXTRACT(User_attributes, "$.resource_group") AS RG FROM mysql.user where user = 'u2';
+------+-------+
| User | RG |
+------+-------+
| u2 | "rg2" |
+------+-------+
1 row in set (0.06 sec)
那么, 如果资源控制特性的权限加以细化,
是不是也应该只能看到当前用户(u2)
被绑定的资源组(rg2)和默认资源组(default),
而不是全部资源组都能看见?
$ mysql -h 192.168.195.128 -P 4000 -c -u u2
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 411
Server version: 5.7.25-TiDB-v7.1.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SELECT * FROM information_schema.resource_groups;
+----------------------------------+------------+----------+-----------+
| NAME | RU_PER_SEC | PRIORITY | BURSTABLE |
+----------------------------------+------------+----------+-----------+
| default | UNLIMITED | MEDIUM | YES |
xxx
| rg2 | 2 | MEDIUM | NO |
xxx
+----------------------------------+------------+----------+-----------+
7 rows in set (0.06 sec)