mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug #26817: mysqldump fails to backup database containing view with invalid definer
give some leeway on required permissions for SHOW FIELDS on views so an unknonwn DEFINER will no longer break mysqldump
This commit is contained in:
@ -1003,6 +1003,11 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
|
||||
CHARSET_INFO *save_cs= thd->variables.character_set_client;
|
||||
thd->variables.character_set_client= system_charset_info;
|
||||
res= MYSQLparse((void *)thd);
|
||||
|
||||
if ((old_lex->sql_command == SQLCOM_SHOW_FIELDS) ||
|
||||
(old_lex->sql_command == SQLCOM_SHOW_CREATE))
|
||||
lex->sql_command= old_lex->sql_command;
|
||||
|
||||
thd->variables.character_set_client= save_cs;
|
||||
thd->variables.sql_mode= save_mode;
|
||||
}
|
||||
@ -1028,7 +1033,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
|
||||
}
|
||||
}
|
||||
else if (!table->prelocking_placeholder &&
|
||||
old_lex->sql_command == SQLCOM_SHOW_CREATE &&
|
||||
(old_lex->sql_command == SQLCOM_SHOW_CREATE) &&
|
||||
!table->belong_to_view)
|
||||
{
|
||||
if (check_table_access(thd, SHOW_VIEW_ACL, table, 0))
|
||||
|
Reference in New Issue
Block a user