Bug #116409 The privilege error of 'use performance_schema' is unreasonable
Submitted: 18 Oct 2024 12:26 Modified: 18 Oct 2024 12:33
Reporter: Xiaocong Ding (OCA) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8.0.39 OS:Any
Assigned to: CPU Architecture:Any
Tags: performance schema, privileges

[18 Oct 2024 12:26] Xiaocong Ding
Description:
For an account, if no privileges are granted on any table under the Performance_schema database, the account can still see the Performance_schema database through the SHOW SCHEMA statement. However, executing USE Performance_schema will result in error 1044.

This is unreasonable because, in versions prior to 8.0.30, the 'u1'@'%' account could not see the performance_schema. This leads to a situation where the schema can be seen but not used, causing some compatibility issues.

How to repeat:
1. Execute statement: 'create user 'u1'@'%' identified by 'abcd';'
2. Don't grant any privilege on this account.
3. Use 'u1'@'%' to login.
4. Execute statement: 'show schemas;' and performance_schema can be seen;
5. Execute statement: 'use performance_schema', there will be an error:'ERROR 1044 (42000): Access denied for user 'u1'@'%' to database 'performance_schema'', which is unreasonable.
[18 Oct 2024 12:33] MySQL Verification Team
Hi Mr. Ding,

Thank you for your bug report.

However, the above is expected behaviour.

We shall check further about this with our PS schema team and we might come back to you if anything else should be added or done ...