diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 0ffdb68a1792a6f6d0fa01242561418762332953..29bd1393322f02c9f22aeedce0c8a9d8d5852a40 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2550,7 +2550,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
 
   if ((thd->master_access & want_access) == want_access)
   {
-    *save_priv=thd->master_access;
+    *save_priv=thd->master_access | thd->db_access;
     DBUG_RETURN(FALSE);
   }
   if (((want_access & ~thd->master_access) & ~(DB_ACLS | EXTRA_ACL)) ||