SOURCES (MYSQL_5_0): mysql-bug-16470.patch - for 5.0

glen glen at pld-linux.org
Wed Oct 24 12:44:23 CEST 2007


Author: glen                         Date: Wed Oct 24 10:44:23 2007 GMT
Module: SOURCES                       Tag: MYSQL_5_0
---- Log message:
- for 5.0

---- Files affected:
SOURCES:
   mysql-bug-16470.patch (1.1 -> 1.1.4.1) 

---- Diffs:

================================================================
Index: SOURCES/mysql-bug-16470.patch
diff -u SOURCES/mysql-bug-16470.patch:1.1 SOURCES/mysql-bug-16470.patch:1.1.4.1
--- SOURCES/mysql-bug-16470.patch:1.1	Wed Oct 24 11:49:00 2007
+++ SOURCES/mysql-bug-16470.patch	Wed Oct 24 12:44:17 2007
@@ -1,5 +1,5 @@
 From: kpettersson
-Date: October 23 2007 4:07pm
+Date: October 24 2007 10:29am
 Subject: bk commit into 5.0 tree (thek:1.2537) BUG#16470
 
 Below is the list of changes that have just been committed into a local
@@ -9,7 +9,7 @@
 For information on how to access the public repository
 see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
 
-ChangeSet at stripped, 2007-10-23 16:07:32+02:00, thek at adventure.(none) +1 -0
+ChangeSet at stripped, 2007-10-24 10:29:24+02:00, thek at adventure.(none) +1 -0
   Bug #16470 crash on grant if old grant tables
   
   If a user upgraded the server without running mysql_upgrade, and later tried
@@ -19,41 +19,42 @@
   This patch fixes this problem by checking if the grant tables were properly
   initialized before attempt to store any new grants.
 
-  sql/sql_acl.cc at stripped, 2007-10-23 16:07:31+02:00, thek at adventure.(none) +9 -3
+  sql/sql_acl.cc at stripped, 2007-10-24 10:29:21+02:00, thek at adventure.(none) +3 -6
     If grant_reload fails, don't try to store new GRANTs because the grant tables
     weren't properly initialized.
 
 diff -Nrup a/sql/sql_acl.cc b/sql/sql_acl.cc
 --- a/sql/sql_acl.cc	2007-06-20 14:24:27 +02:00
-+++ b/sql/sql_acl.cc	2007-10-23 16:07:31 +02:00
-@@ -2786,7 +2786,12 @@ bool mysql_table_grant(THD *thd, TABLE_L
-                MYF(0));
-     DBUG_RETURN(TRUE);
++++ b/sql/sql_acl.cc	2007-10-24 10:29:21 +02:00
+@@ -2780,7 +2780,7 @@ bool mysql_table_grant(THD *thd, TABLE_L
+              "--skip-grant-tables");	/* purecov: inspected */
+     DBUG_RETURN(TRUE);				/* purecov: inspected */
    }
--
-+  if (!grant_option)
-+  {
-+    my_message(ER_TABLE_NEEDS_UPGRADE, ER(ER_ILLEGAL_GRANT_FOR_TABLE),
-+                MYF(0));
-+    DBUG_RETURN(TRUE);
-+  }
-   if (!revoke_grant)
+-  if (rights & ~TABLE_ACLS)
++  if ((rights & ~TABLE_ACLS) || !grant_option)
    {
-     if (columns.elements)
-@@ -3335,13 +3340,14 @@ my_bool grant_init()
+     my_message(ER_ILLEGAL_GRANT_FOR_TABLE, ER(ER_ILLEGAL_GRANT_FOR_TABLE),
+                MYF(0));
+@@ -3328,20 +3328,17 @@ void  grant_free(void)
+ my_bool grant_init()
+ {
+   THD  *thd;
+-  my_bool return_val;
+   DBUG_ENTER("grant_init");
+ 
+   if (!(thd= new THD))
      DBUG_RETURN(1);				/* purecov: deadcode */
    thd->thread_stack= (char*) &thd;
    thd->store_globals();
 -  return_val=  grant_reload(thd);
-+  if (grant_reload(thd))
-+    return TRUE;
++  grant_option= !grant_reload(thd);
    delete thd;
    /* Remember that we don't have a THD */
    my_pthread_setspecific_ptr(THR_THD,  0);
-   /* Set the grant option flag so we will check grants */
-   grant_option= TRUE;
+-  /* Set the grant option flag so we will check grants */
+-  grant_option= TRUE;
 -  DBUG_RETURN(return_val);
-+  DBUG_RETURN(FALSE);
++  DBUG_RETURN(!grant_option);
  }
  
  
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/mysql-bug-16470.patch?r1=1.1&r2=1.1.4.1&f=u



More information about the pld-cvs-commit mailing list