Description:
If a user with CREATE VIEW grant but not SELECT GRANT tries to create a view that references a table, the error that is generated is the proper error number but the error message is built incorrectly:
ERROR 1142 (42000): ANY command denied to user \
'create_view'@'localhost' for table 't1'
'ANY' should be 'SELECT'
How to repeat:
# as root user
GRANT CREATE VIEW ON privDB.* TO 'create_view'@'localhost'
IDENTIFIED BY 'create_view';
# Log in as create_view
CREATE VIEW view_foo AS SELECT * FROM test.foo;
# result
# ERROR 1142 (42000): ANY command denied to user \
# 'create_view'@'localhost' for table 'foo'
# if you do this though you get the correct error
SELECT * FROM test.foo;
# result
# ERROR 1142 (42000): SELECT command denied to user \
# 'create_view'@'localhost' for table 'foo'
Description: If a user with CREATE VIEW grant but not SELECT GRANT tries to create a view that references a table, the error that is generated is the proper error number but the error message is built incorrectly: ERROR 1142 (42000): ANY command denied to user \ 'create_view'@'localhost' for table 't1' 'ANY' should be 'SELECT' How to repeat: # as root user GRANT CREATE VIEW ON privDB.* TO 'create_view'@'localhost' IDENTIFIED BY 'create_view'; # Log in as create_view CREATE VIEW view_foo AS SELECT * FROM test.foo; # result # ERROR 1142 (42000): ANY command denied to user \ # 'create_view'@'localhost' for table 'foo' # if you do this though you get the correct error SELECT * FROM test.foo; # result # ERROR 1142 (42000): SELECT command denied to user \ # 'create_view'@'localhost' for table 'foo'