List:Commits« Previous MessageNext Message »
From:He Zhenxing Date:May 19 2009 7:32am
Subject:bzr commit into mysql-6.0-rpl branch (zhenxing.he:2856) Bug#34227
View as plain text  
#At file:///media/sdb2/hezx/work/mysql/bzrwork/b34227/6.0-rpl/ based on revid:luis.soares@strippedc3hqaygypxotgg0

 2856 He Zhenxing	2009-05-19
      BUG#34227 Replication permission error message is misleading
      
      According to Jon's comment, undo previous patch, and add (at least
      one of) to the error message instead.

    M  mysql-test/r/mysqldump.result
    M  sql/share/errmsg.txt
    M  sql/sp_head.cc
    M  sql/sql_acl.cc
    M  sql/sql_acl.h
    M  sql/sql_parse.cc
=== modified file 'mysql-test/r/mysqldump.result'
--- a/mysql-test/r/mysqldump.result	2009-04-30 14:35:36 +0000
+++ b/mysql-test/r/mysqldump.result	2009-05-19 07:32:32 +0000
@@ -3555,11 +3555,11 @@ use test;
 create user mysqltest_1@localhost;
 create table t1(a int, b varchar(34));
 reset master;
-mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need the RELOAD privilege for this operation (1227)
-mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need the RELOAD privilege for this operation (1227)
+mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need (at least one of) the RELOAD privilege(s) for this operation (1227)
+mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need (at least one of) the RELOAD privilege(s) for this operation (1227)
 grant RELOAD on *.* to mysqltest_1@localhost;
-mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER|REPLICATION CLIENT privilege for this operation (1227)
-mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER|REPLICATION CLIENT privilege for this operation (1227)
+mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation (1227)
+mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation (1227)
 grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
 drop table t1;
 drop user mysqltest_1@localhost;

=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt	2009-04-30 14:35:36 +0000
+++ b/sql/share/errmsg.txt	2009-05-19 07:32:32 +0000
@@ -4620,7 +4620,7 @@ ER_USER_LIMIT_REACHED 42000 
         swe "Anv�are '%-.64s' har �skridit '%s' (nuvarande v�e: %ld)"
 ER_SPECIFIC_ACCESS_DENIED_ERROR 42000 
         nla "Toegang geweigerd. U moet het %-.128s privilege hebben voor deze operatie"
-        eng "Access denied; you need the %-.128s privilege for this operation"
+        eng "Access denied; you need (at least one of) the %-.128s privilege(s) for this operation"
         ger "Kein Zugriff. Hierf�d die Berechtigung %-.128s ben�t"
         ita "Accesso non consentito. Serve il privilegio %-.128s per questa operazione"
         por "Acesso negado. Voc�recisa o privil�o %-.128s para essa opera�"

=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc	2009-05-14 12:18:09 +0000
+++ b/sql/sp_head.cc	2009-05-19 07:32:32 +0000
@@ -1519,7 +1519,7 @@ sp_head::execute_trigger(THD *thd,
   if (!(grant_info->privilege & TRIGGER_ACL))
   {
     char priv_desc[128];
-    get_privilege_desc(priv_desc, sizeof(priv_desc), TRIGGER_ACL, FALSE);
+    get_privilege_desc(priv_desc, sizeof(priv_desc), TRIGGER_ACL);
 
     my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), priv_desc,
              thd->security_ctx->priv_user, thd->security_ctx->host_or_ip,

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2009-05-07 20:48:24 +0000
+++ b/sql/sql_acl.cc	2009-05-19 07:32:32 +0000
@@ -3015,7 +3015,7 @@ int mysql_table_grant(THD *thd, TABLE_LI
       {
         char command[128];
         get_privilege_desc(command, sizeof(command),
-                           table_list->grant.want_privilege, FALSE);
+                           table_list->grant.want_privilege);
         my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
                  command, thd->security_ctx->priv_user,
                  thd->security_ctx->host_or_ip, table_list->alias);
@@ -3993,7 +3993,7 @@ err:
   if (!no_errors)				// Not a silent skip of table
   {
     char command[128];
-    get_privilege_desc(command, sizeof(command), want_access, FALSE);
+    get_privilege_desc(command, sizeof(command), want_access);
     my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
              command,
              sctx->priv_user,
@@ -4149,7 +4149,7 @@ bool check_grant_column(THD *thd, GRANT_
 err:
   rw_unlock(&LOCK_grant);
   char command[128];
-  get_privilege_desc(command, sizeof(command), want_access, FALSE);
+  get_privilege_desc(command, sizeof(command), want_access);
   my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0),
            command,
            sctx->priv_user,
@@ -4311,7 +4311,7 @@ err:
   rw_unlock(&LOCK_grant);
 
   char command[128];
-  get_privilege_desc(command, sizeof(command), want_access, FALSE);
+  get_privilege_desc(command, sizeof(command), want_access);
   /*
     Do not give an error message listing a column name unless the user has
     privilege to see all columns.
@@ -5063,25 +5063,16 @@ static int show_routine_grants(THD* thd,
   return error;
 }
 
-/**
+/*
   Make a clear-text version of the requested privilege.
-
-  @param to         pointer to the buffer
-  @param max_length max length of the description message allowed
-  @param access     privileges to check for access
-  @param any        if TRUE, any of the privileges is sufficient,
-                    if FALSE, all privileges are required
 */
 
-void get_privilege_desc(char *to, uint max_length, ulong access, bool any)
+void get_privilege_desc(char *to, uint max_length, ulong access)
 {
   uint pos;
   char *start=to;
-  char sep=',';
   DBUG_ASSERT(max_length >= 30);		// For end ',' removal
 
-  if (any)
-    sep= '|';
   if (access)
   {
     max_length--;				// Reserve place for end-zero
@@ -5091,7 +5082,7 @@ void get_privilege_desc(char *to, uint m
 	  command_lengths[pos] + (uint) (to-start) < max_length)
       {
 	to= strmov(to, command_array[pos]);
-	*to++= sep;
+	*to++=',';
       }
     }
     to--;					// Remove end ','

=== modified file 'sql/sql_acl.h'
--- a/sql/sql_acl.h	2009-04-02 08:50:24 +0000
+++ b/sql/sql_acl.h	2009-05-19 07:32:32 +0000
@@ -261,7 +261,7 @@ ulong get_column_grant(THD *thd, GRANT_I
                        const char *db_name, const char *table_name,
                        const char *field_name);
 bool mysql_show_grants(THD *thd, LEX_USER *user);
-void get_privilege_desc(char *to, uint max_length, ulong access, bool any);
+void get_privilege_desc(char *to, uint max_length, ulong access);
 void get_mqh(const char *user, const char *host, USER_CONN *uc);
 bool mysql_create_user(THD *thd, List <LEX_USER> &list);
 bool mysql_drop_user(THD *thd, List <LEX_USER> &list);

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2009-05-18 08:41:20 +0000
+++ b/sql/sql_parse.cc	2009-05-19 07:32:32 +0000
@@ -5556,7 +5556,7 @@ bool check_global_access(THD *thd, ulong
   char command[128];
   if ((thd->security_ctx->master_access & want_access))
     return 0;
-  get_privilege_desc(command, sizeof(command), want_access, TRUE);
+  get_privilege_desc(command, sizeof(command), want_access);
   my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);
   return 1;
 #else

Attachment: [text/bzr-bundle] bzr/zhenxing.he@sun.com-20090519073232-unryo2onbzx2j1mi.bundle
Thread
bzr commit into mysql-6.0-rpl branch (zhenxing.he:2856) Bug#34227He Zhenxing19 May