Bug #117014 | EXECUTE grant required when SHOW CREATE VIEW over view with json_table | ||
---|---|---|---|
Submitted: | 18 Dec 2024 14:30 | Modified: | 19 Dec 2024 11:08 |
Reporter: | David Ducos | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | mysqldump |
[18 Dec 2024 14:30]
David Ducos
[18 Dec 2024 15:02]
MySQL Verification Team
Hi Mr. Ducos, Thank you for your bug report. However, we can not repeat your test case, since you are using tables that are not defined in your test case. Can't repeat.
[18 Dec 2024 15:24]
David Ducos
sql file to reproduce the issue
Attachment: mydumper_test.sql.txt (text/plain), 3.15 KiB.
[18 Dec 2024 15:25]
David Ducos
Hello, Attached you will find the remaining table structures needed to reproduce the issue.
[18 Dec 2024 16:05]
MySQL Verification Team
Hi Mr. Ducos, We still cannot repeat your test case. We get the error that is totally, totally expected: ERROR 1142 (42000): SELECT command denied to user 'david'@'localhost' for table 'helper_view_2' We also get lot's of errors with your dump and we shall definitely not edit any of your data so that we would get read of the syntax errors. Can't repeat.
[18 Dec 2024 17:56]
David Ducos
test file after removing definer
Attachment: mydumper_test.sql (application/octet-stream, text), 3.08 KiB.
[18 Dec 2024 18:07]
David Ducos
How to repeat: 1- Create the database with root user: mysql> CREATE DATABASE mydumper_test; 2- Import the file using your root user: $ mysql mydumper_test < mydumper_test.sql 3- Create a user with minimal privileges: mysql> CREATE USER david@'%' IDENTIFIED BY 'david'; mysql> GRANT LOCK TABLES, REPLICATION CLIENT ON *.* TO `david`@`%`; mysql> GRANT BACKUP_ADMIN,FLUSH_TABLES ON *.* TO `david`@`%`; mysql> GRANT SELECT, SHOW VIEW ON `mydumper_test`.* TO `david`@`%`; 4- Connect to the database with the user without the EXECUTE privilege: $ mysql -h $MYSQL_HOST -u david -pdavid mysql> show create view `helper_view_2`; ERROR 1235 (42000): This version of MySQL doesn't yet support 'SHOW CREATE VIEW on a view that references a non-existent table and a table function.' 4- With your root user, grant the EXECUTE privilege to the new user: mysql> GRANT EXECUTE ON *.* TO david@'%'; 5- Check again the SHOW CREATE VIEW and it will work: $ mysql -h $MYSQL_HOST -u david -pdavid mysql> show create view `helper_view_2`; I hope that now you can reproduce the issue.
[19 Dec 2024 11:08]
MySQL Verification Team
Hi Mr. Ducos, We repeated your bug report. This is now a verified bug for our Documentation team. Verified for version 8.0 and all supported versions.