1
0
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:
bell@sanja.is.com.ua
2004-09-17 22:23:59 +03:00
parent 26589ba8ce
commit 74e7df0d80
4 changed files with 24 additions and 20 deletions

View File

@@ -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 &&