MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:dlenev Date:September 1 2005 9:01pm
Subject:bk commit into 5.0 tree (dlenev:1.1937) BUG#12423
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of dlenev. When dlenev does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1937 05/09/02 01:01:33 dlenev@stripped +1 -0
  Fixes after merging fix for bug #12423 "Deadlock when doing FLUSH PRIVILEGES
  and GRANT in multi-threaded environment" into 5.0 tree.

  sql/sql_acl.cc
    1.167 05/09/02 01:01:25 dlenev@stripped +23 -20
    After merge fixes.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	dlenev
# Host:	brandersnatch.localdomain
# Root:	/home/dlenev/src/mysql-5.0-merges

--- 1.166/sql/sql_acl.cc	2005-09-01 23:25:24 +04:00
+++ 1.167/sql/sql_acl.cc	2005-09-02 01:01:25 +04:00
@@ -539,12 +539,12 @@
     obtaining acl_cache->lock mutex.
   */
   bzero((char*) tables, sizeof(tables));
-  tables[0].alias=tables[0].real_name=(char*) "host";
-  tables[1].alias=tables[1].real_name=(char*) "user";
-  tables[2].alias=tables[2].real_name=(char*) "db";
-  tables[0].db=tables[1].db=tables[2].db= (char*) "mysql";
-  tables[0].next= tables+1;
-  tables[1].next= tables+2;
+  tables[0].alias= tables[0].table_name= (char*) "host";
+  tables[1].alias= tables[1].table_name= (char*) "user";
+  tables[2].alias= tables[2].table_name= (char*) "db";
+  tables[0].db=tables[1].db=tables[2].db=(char*) "mysql";
+  tables[0].next_local= tables[0].next_global= tables+1;
+  tables[1].next_local= tables[1].next_global= tables+2;
   tables[0].lock_type=tables[1].lock_type=tables[2].lock_type=TL_READ;
 
   if (simple_open_n_lock_tables(thd, tables))
@@ -1391,7 +1391,7 @@
     DBUG_RETURN(1);
 
   bzero((char*) &tables, sizeof(tables));
-  tables.alias=tables.real_name= (char*) "user";
+  tables.alias= tables.table_name= (char*) "user";
   tables.db= (char*) "mysql";
 
 #ifdef HAVE_REPLICATION
@@ -1407,7 +1407,7 @@
     */
     tables.updating= 1;
     /* Thanks to bzero, tables.next==0 */
-    if (!tables_ok(0, &tables))
+    if (!tables_ok(thd, &tables))
       DBUG_RETURN(0);
   }
 #endif
@@ -1438,14 +1438,14 @@
   acl_cache->clear(1);				// Clear locked hostname cache
   VOID(pthread_mutex_unlock(&acl_cache->lock));
   result= 0;
-  query_length=
-    my_sprintf(buff,
-	       (buff,"SET PASSWORD FOR \"%-.120s\"@\"%-.120s\"=\"%-.120s\"",
-		acl_user->user ? acl_user->user : "",
-		acl_user->host.hostname ? acl_user->host.hostname : "",
-		new_password));
   if (mysql_bin_log.is_open())
   {
+    query_length=
+      my_sprintf(buff,
+                 (buff,"SET PASSWORD FOR \"%-.120s\"@\"%-.120s\"=\"%-.120s\"",
+                  acl_user->user ? acl_user->user : "",
+                  acl_user->host.hostname ? acl_user->host.hostname : "",
+                  new_password));
     thd->clear_error();
     Query_log_event qinfo(thd, buff, query_length, 0, FALSE);
     mysql_bin_log.write(&qinfo);
@@ -3353,6 +3353,7 @@
 
 end_unlock:
   t_table->file->ha_index_end();
+  p_table->file->ha_index_end();
   my_pthread_setspecific_ptr(THR_MALLOC, save_mem_root_ptr);
   DBUG_RETURN(return_val);
 }
@@ -3378,7 +3379,7 @@
 
 my_bool grant_reload(THD *thd)
 {
-  TABLE_LIST tables[2];
+  TABLE_LIST tables[3];
   HASH old_column_priv_hash, old_proc_priv_hash, old_func_priv_hash;
   bool old_grant_option;
   MEM_ROOT old_mem;
@@ -3390,11 +3391,13 @@
     DBUG_RETURN(0);
 
   bzero((char*) tables, sizeof(tables));
-  tables[0].alias=tables[0].real_name= (char*) "tables_priv";
-  tables[1].alias=tables[1].real_name= (char*) "columns_priv";
-  tables[0].db=tables[1].db= (char *) "mysql";
-  tables[0].next=tables+1;
-  tables[0].lock_type=tables[1].lock_type=TL_READ;
+  tables[0].alias= tables[0].table_name= (char*) "tables_priv";
+  tables[1].alias= tables[1].table_name= (char*) "columns_priv";
+  tables[2].alias= tables[2].table_name= (char*) "procs_priv";
+  tables[0].db= tables[1].db= tables[2].db= (char *) "mysql";
+  tables[0].next_local= tables[0].next_global= tables+1;
+  tables[1].next_local= tables[1].next_global= tables+2;
+  tables[0].lock_type= tables[1].lock_type= tables[2].lock_type= TL_READ;
 
   /*
     To avoid deadlocks we should obtain table locks before
Thread
bk commit into 5.0 tree (dlenev:1.1937) BUG#12423dlenev1 Sep