【 TiDB 使用环境】Poc
【 TiDB 版本】 7.1
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【附件:截图/日志/监控】
在7.1中,可以通过表 mysql.user 和 INFORMATION_SCHEMA.USER_ATTRIBUTES 查看用户属性,
但是,目前只有 mysql.user 的 User_attributes 字段可以看到 resource group 信息,
master ← CbcWestwolf:add_more_comments
已打开 08:21AM - 27 Sep 22 UTC
### What problem does this PR solve?
Issue Number: close #38172
Problem Su… mmary:
MySQL 8.0.21 introduced `ATTRIBUTE` and `COMMENT` in `CREATE USER` and `ALTER USER` statements, TiDB hasn't implemented it yet.
### What is changed and how it works?
Add a column `user_attributes` to `mysql.user` table to store `ATTRIBUTE` and `COMMENT`, and add a view `information_schema.user_attributes` for users to access user attributes.
### Check List
Tests
- [x] Unit test
- [ ] Integration test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No code
Side effects
- [ ] Performance regression: Consumes more CPU
- [ ] Performance regression: Consumes more Memory
- [ ] Breaking backward compatibility
Documentation
- [ ] Affects user behaviors
- [x] Contains syntax changes
- [ ] Contains variable changes
- [ ] Contains experimental features
- [x] Changes MySQL compatibility
### Release note
Please refer to [Release Notes Language Style Guide](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.
```release-note
1. Support `ATTRIBUTE` and `COMMENT` in `CREATE USER` and `ALTER USER` statements
2. Add a new column `user_attributes` to `mysql.user`, and add a new view `information_schema.user_attributes`
```
已提交 06:35AM - 20 Oct 22 UTC
Add a column user_attributes to mysql.user table to store ATTRIBUTE and COMMENT, and add a view information_schema.user_attributes for users to access user attributes.
在资源管控功能实现后,是否应该把 INFORMATION_SCHEMA.USER_ATTRIBUTES 取值也更新一下?
https://github.com/pingcap/tidb/blob/master/executor/infoschema_reader.go#L283
比如把 INFORMATION_SCHEMA.USER_ATTRIBUTES 字段 ATTRIBUTE 改名为 metadata, 再新加一个字段 resource_group。
1 个赞
此话题已在最后回复的 60 天后被自动关闭。不再允许新回复。