diff options
author | Marc Alff <marc.alff@oracle.com> | 2010-07-15 18:50:39 -0600 |
---|---|---|
committer | Marc Alff <marc.alff@oracle.com> | 2010-07-15 18:50:39 -0600 |
commit | a809475699666501017746d95263ec5f5160bedc (patch) | |
tree | 9a74d435c3f0b9e58e72a860d62c67fafb439c1b /storage/perfschema | |
parent | 9f27e289764f3d4e6d921b69cb2ea19e8c99bfb2 (diff) | |
download | mariadb-git-a809475699666501017746d95263ec5f5160bedc.tar.gz |
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)
Diffstat (limited to 'storage/perfschema')
-rw-r--r-- | storage/perfschema/pfs_engine_table.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc index 2d16c34064f..30c9ac966c4 100644 --- a/storage/perfschema/pfs_engine_table.cc +++ b/storage/perfschema/pfs_engine_table.cc @@ -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; } /** |