mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#52586 Misleading error message on attempt to access a P_S table using a wrong name
Backport from mysql-next-mr (5.6) to mysql-trunk (5.5)
This commit is contained in:
@ -466,7 +466,22 @@ PFS_unknown_acl pfs_unknown_acl;
|
||||
ACL_internal_access_result
|
||||
PFS_unknown_acl::check(ulong want_access, ulong *save_priv) const
|
||||
{
|
||||
return ACL_INTERNAL_ACCESS_DENIED;
|
||||
const ulong always_forbidden= INSERT_ACL | UPDATE_ACL | DELETE_ACL
|
||||
| CREATE_ACL | REFERENCES_ACL | INDEX_ACL | ALTER_ACL
|
||||
| CREATE_VIEW_ACL | TRIGGER_ACL | LOCK_TABLES_ACL;
|
||||
|
||||
if (unlikely(want_access & always_forbidden))
|
||||
return ACL_INTERNAL_ACCESS_DENIED;
|
||||
|
||||
/*
|
||||
There is no point in hidding (by enforcing ACCESS_DENIED for SELECT_ACL
|
||||
on performance_schema.*) tables that do not exist anyway.
|
||||
When SELECT_ACL is granted on performance_schema.* or *.*,
|
||||
SELECT * from performance_schema.wrong_table
|
||||
will fail with a more understandable ER_NO_SUCH_TABLE error,
|
||||
instead of ER_TABLEACCESS_DENIED_ERROR.
|
||||
*/
|
||||
return ACL_INTERNAL_ACCESS_CHECK_GRANT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user