mirror of
https://github.com/MariaDB/server.git
synced 2025-09-11 05:52:26 +03:00
SHOW CREATE VIEW (TABLE) privilege now reqiere show create privilege
(BUG#4777)
This commit is contained in:
@@ -624,16 +624,20 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
|
||||
check rights to run commands (EXPLAIN SELECT & SHOW CREATE) which show
|
||||
underlaying tables
|
||||
*/
|
||||
if ((old_lex->sql_command == SQLCOM_SELECT && old_lex->describe) ||
|
||||
old_lex->sql_command == SQLCOM_SHOW_CREATE)
|
||||
if ((old_lex->sql_command == SQLCOM_SELECT && old_lex->describe))
|
||||
{
|
||||
if (check_table_access(thd, SELECT_ACL, view_tables, 1) &&
|
||||
check_table_access(thd, SHOW_VIEW_ACL, view_tables, 1))
|
||||
check_table_access(thd, SHOW_VIEW_ACL, table, 1))
|
||||
{
|
||||
my_error(ER_VIEW_NO_EXPLAIN, MYF(0));
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
else if (old_lex->sql_command == SQLCOM_SHOW_CREATE)
|
||||
{
|
||||
if (check_table_access(thd, SHOW_VIEW_ACL, table, 0))
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* move SQL_NO_CACHE & Co to whole query */
|
||||
old_lex->safe_to_cache_query= (old_lex->safe_to_cache_query &&
|
||||
|
Reference in New Issue
Block a user