Error querying mysql.tidb_mdl_view

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 查询mysql.tidb_mdl_view报错

| username: h5n1

Upgraded from 7.5.1 to 8.1.0
Error when root user queries mdl_view

mysql> select * from tidb_mdl_view;
ERROR 1356 (HY000): View 'mysql.tidb_mdl_view' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

Querying a few tables alone is fine.

Recreating with the same conditions and querying also results in an error.

Querying with the view’s conditions alone is fine.

Testing the two functions in the view’s columns alone is fine.

Creating the view without authorization is fine.

No issues after modifying view permissions.

The view permission definition in 7.5.1 is the same and has no issues.

| username: TiDBer_Vk3zlHTJ | Original post link

It appears to be a known issue Root user lack rights to use `tidb_mdl_view` · Issue #53292 · pingcap/tidb · GitHub
It has already been fixed on the master branch.