summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/sp_head.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index e87e03c1db7..f568a2d3e68 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -2574,8 +2574,9 @@ bool check_show_routine_access(THD *thd, sp_head *sp, bool *full_access)
bzero((char*) &tables,sizeof(tables));
tables.db= (char*) "mysql";
tables.table_name= tables.alias= (char*) "proc";
- *full_access= (!check_table_access(thd, SELECT_ACL, &tables, FALSE,
- 1, TRUE) ||
+ *full_access= ((!check_table_access(thd, SELECT_ACL, &tables, FALSE,
+ 1, TRUE) &&
+ (tables.grant.privilege & SELECT_ACL) != 0) ||
(!strcmp(sp->m_definer_user.str,
thd->security_ctx->priv_user) &&
!strcmp(sp->m_definer_host.str,