mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MDEV-37971 CHECK TABLE command can be executed by users with the table-level CREATE but not with global CREATE
CHECK TABLE was inconsistently requiring SELECT privilege on global/db level or any privilege on the table/column level. Change to require any table-applicable privilege on any level.
This commit is contained in:
@@ -1589,9 +1589,14 @@ bool Sql_cmd_check_table::execute(THD *thd)
|
||||
bool res= TRUE;
|
||||
DBUG_ENTER("Sql_cmd_check_table::execute");
|
||||
|
||||
if (check_table_access(thd, SELECT_ACL, first_table,
|
||||
TRUE, UINT_MAX, FALSE))
|
||||
if (check_some_access(thd, TABLE_ACLS, first_table))
|
||||
{
|
||||
my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), "CHECK TABLE",
|
||||
thd->security_ctx->priv_user,
|
||||
thd->security_ctx->host_or_ip,
|
||||
first_table->db.str, first_table->table_name.str);
|
||||
goto error; /* purecov: inspected */
|
||||
}
|
||||
|
||||
res= mysql_admin_table(thd, first_table, &m_lex->check_opt, &msg_check,
|
||||
lock_type, 0, 0, HA_OPEN_FOR_REPAIR, 0,
|
||||
|
||||
Reference in New Issue
Block a user