1
0
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:
Marc Alff
2010-07-15 18:50:39 -06:00
parent bc6092a497
commit 36e80ced63
3 changed files with 28 additions and 5 deletions

View File

@ -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;
}
/**