List:Internals« Previous MessageNext Message »
From:monty Date:July 27 2005 12:25pm
Subject:bk commit into 4.1 tree (monty:1.2349)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of monty. When monty 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.2349 05/07/27 13:24:59 monty@stripped +7 -0
  Merge mysql.com:/home/my/mysql-4.0
  into  mysql.com:/home/my/mysql-4.1

  sql/sql_base.cc
    1.257 05/07/27 13:24:56 monty@stripped +3 -8
    Simple merge

  sql/slave.cc
    1.272 05/07/27 13:21:36 monty@stripped +0 -0
    Auto merged

  sql/mysql_priv.h
    1.361 05/07/27 13:21:36 monty@stripped +0 -0
    Auto merged

  sql/lock.cc
    1.61 05/07/27 13:21:36 monty@stripped +0 -0
    Auto merged

  mysys/thr_lock.c
    1.41 05/07/27 13:21:36 monty@stripped +0 -0
    Auto merged

  include/thr_lock.h
    1.15 05/07/27 13:21:36 monty@stripped +0 -0
    Auto merged

  BitKeeper/etc/ignore
    1.229 05/07/27 13:21:29 monty@stripped +1 -2
    auto-union

# 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:	monty
# Host:	narttu.mysql.com
# Root:	/home/my/mysql-4.1/RESYNC

--- 1.14/include/thr_lock.h	2005-07-21 04:53:06 +03:00
+++ 1.15/include/thr_lock.h	2005-07-27 13:21:36 +03:00
@@ -111,7 +111,7 @@
 int thr_multi_lock(THR_LOCK_DATA **data,uint count);
 void thr_multi_unlock(THR_LOCK_DATA **data,uint count);
 void thr_abort_locks(THR_LOCK *lock);
-bool thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread);
+my_bool thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread);
 void thr_print_locks(void);		/* For debugging */
 my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data);
 my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data);

--- 1.40/mysys/thr_lock.c	2005-07-21 04:53:07 +03:00
+++ 1.41/mysys/thr_lock.c	2005-07-27 13:21:36 +03:00
@@ -966,10 +966,10 @@
   This is used to abort all locks for a specific thread
 */
 
-bool thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread)
+my_bool thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread)
 {
   THR_LOCK_DATA *data;
-  bool found= FALSE;
+  my_bool found= FALSE;
   DBUG_ENTER("thr_abort_locks_for_thread");
 
   pthread_mutex_lock(&lock->mutex);

--- 1.60/sql/lock.cc	2005-07-27 01:54:24 +03:00
+++ 1.61/sql/lock.cc	2005-07-27 13:21:36 +03:00
@@ -335,7 +335,18 @@
 }
 
 
-/* Abort one thread / table combination */
+/*
+  Abort one thread / table combination
+
+  SYNOPSIS
+    mysql_lock_abort_for_thread()
+    thd		Thread handler
+    table	Table that should be removed from lock queue
+
+  RETURN
+    0  Table was not locked by another thread
+    1  Table was locked by at least one other thread
+*/
 
 bool mysql_lock_abort_for_thread(THD *thd, TABLE *table)
 {
@@ -348,10 +359,9 @@
   {
     for (uint i=0; i < locked->lock_count; i++)
     {
-      bool found;
-      found= thr_abort_locks_for_thread(locked->locks[i]->lock,
-	         			 table->in_use->real_id);
-      result|= found;
+      if (thr_abort_locks_for_thread(locked->locks[i]->lock,
+                                     table->in_use->real_id))
+        result= TRUE;
     }
     my_free((gptr) locked,MYF(0));
   }

--- 1.360/sql/mysql_priv.h	2005-07-27 01:54:24 +03:00
+++ 1.361/sql/mysql_priv.h	2005-07-27 13:21:36 +03:00
@@ -763,12 +763,15 @@
 			    const char *table_name);
 void remove_db_from_cache(const char *db);
 void flush_tables();
+
+/* bits for last argument to remove_table_from_cache() */
 #define RTFC_NO_FLAG                0x0000
 #define RTFC_OWNED_BY_THD_FLAG      0x0001
 #define RTFC_WAIT_OTHER_THREAD_FLAG 0x0002
 #define RTFC_CHECK_KILLED_FLAG      0x0004
 bool remove_table_from_cache(THD *thd, const char *db, const char *table,
                              uint flags);
+
 bool close_cached_tables(THD *thd, bool wait_for_refresh, TABLE_LIST *tables);
 void copy_field_from_tmp_record(Field *field,int offset);
 int fill_record(List<Item> &fields,List<Item> &values, bool
ignore_errors);

--- 1.271/sql/slave.cc	2005-07-14 10:35:32 +03:00
+++ 1.272/sql/slave.cc	2005-07-27 13:21:36 +03:00
@@ -3331,9 +3331,9 @@
   mi->abort_slave = 0; // TODO: check if this is needed
   DBUG_ASSERT(thd->net.buff != 0);
   net_end(&thd->net); // destructor will not free it, because net.vio is 0
+  close_thread_tables(thd, 0);
   pthread_mutex_lock(&LOCK_thread_count);
   THD_CHECK_SENTRY(thd);
-  close_thread_tables(thd);
   delete thd;
   pthread_mutex_unlock(&LOCK_thread_count);
   pthread_cond_broadcast(&mi->stop_cond);	// tell the world we are done

--- 1.256/sql/sql_base.cc	2005-07-21 04:53:17 +03:00
+++ 1.257/sql/sql_base.cc	2005-07-27 13:24:56 +03:00
@@ -2927,6 +2927,9 @@
   The table will be closed (not stored in cache) by the current thread when
   close_thread_tables() is called.
 
+  PREREQUISITES
+    Lock on LOCK_open()
+
   RETURN
     0  This thread now have exclusive access to this table and no other thread
        can access the table until close_thread_tables() is called.
@@ -2942,6 +2945,7 @@
   bool result=0, signalled= 0;
   DBUG_ENTER("remove_table_from_cache");
 
+
   key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
   for (;;)
   {
@@ -2999,15 +3003,12 @@
     {
       if (!(flags & RTFC_CHECK_KILLED_FLAG) || !thd->killed)
       {
+        dropping_tables++;
         if (likely(signalled))
-        {
-          dropping_tables++;
           (void) pthread_cond_wait(&COND_refresh, &LOCK_open);
-          dropping_tables--;
-          continue;
-        }
         else
         {
+          struct timespec abstime;
           /*
             It can happen that another thread has opened the
             table but has not yet locked any table at all. Since
@@ -3018,11 +3019,11 @@
             and then we retry another loop in the
             remove_table_from_cache routine.
           */
-          pthread_mutex_unlock(&LOCK_open);
-          my_sleep(10);
-          pthread_mutex_lock(&LOCK_open);
-          continue;
+          set_timespec(abstime, 10);
+          pthread_cond_timedwait(&COND_refresh, &LOCK_open, &abstime);
         }
+        dropping_tables--;
+        continue;
       }
     }
     break;

--- 1.228/BitKeeper/etc/ignore	2005-06-07 05:17:13 +03:00
+++ 1.229/BitKeeper/etc/ignore	2005-07-27 13:21:29 +03:00
@@ -890,6 +890,7 @@
 scripts/mysqld_safe
 scripts/mysqldumpslow
 scripts/mysqlhotcopy
+scripts/mysqlhotcopy.sh.rej
 scripts/safe_mysqld
 select_test
 sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686
@@ -1052,4 +1053,3 @@
 vio/test-sslclient
 vio/test-sslserver
 vio/viotest-ssl
-scripts/mysqlhotcopy.sh.rej
Thread
bk commit into 4.1 tree (monty:1.2349)monty27 Jul