List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:December 23 2005 7:50pm
Subject:bk commit into 5.0 tree (serg:1.1991)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of serg. When serg 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.1991 05/12/23 20:50:28 serg@stripped +4 -0
  locking issues,
  test for LONGLONG_MIN in decimal.c

  strings/decimal.c
    1.66 05/12/23 20:50:09 serg@stripped +4 -3
    correct the test for LONGLONG_MIN. fix debug sprintf

  server-tools/instance-manager/instance.cc
    1.31 05/12/23 20:50:09 serg@stripped +3 -0
    add unlock

  mysys/thr_alarm.c
    1.49 05/12/23 20:50:09 serg@stripped +9 -15
    remove misplaced comment and "safety" if()

  myisam/mi_create.c
    1.52 05/12/23 20:50:09 serg@stripped +3 -2
    lock THR_LOCK_myisam later

# 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:	serg
# Host:	serg.mylan
# Root:	/usr/home/serg/Abk/mysql-5.0

--- 1.51/myisam/mi_create.c	Wed Jul 27 09:49:40 2005
+++ 1.52/myisam/mi_create.c	Fri Dec 23 20:50:09 2005
@@ -72,7 +72,6 @@ int mi_create(const char *name,uint keys
   }
   LINT_INIT(dfile);
   LINT_INIT(file);
-  pthread_mutex_lock(&THR_LOCK_myisam);
   errpos=0;
   options=0;
   bzero((byte*) &share,sizeof(share));
@@ -135,7 +134,7 @@ int mi_create(const char *name,uint keys
 	pack_reclength++;
         min_pack_length++;
         /* We must test for 257 as length includes pack-length */
- 	if (test(rec->length >= 257))
+        if (test(rec->length >= 257))
 	{
 	  long_varchar_count++;
 	  pack_reclength+= 2;			/* May be packed on 3 bytes */
@@ -541,6 +540,8 @@ int mi_create(const char *name,uint keys
     MI_EXTEND_BLOCK_LENGTH;
   if (! (flags & HA_DONT_TOUCH_DATA))
     share.state.create_time= (long) time((time_t*) 0);
+
+  pthread_mutex_lock(&THR_LOCK_myisam);
 
   if (ci->index_file_name)
   {

--- 1.48/mysys/thr_alarm.c	Thu Oct 13 16:36:41 2005
+++ 1.49/mysys/thr_alarm.c	Fri Dec 23 20:50:09 2005
@@ -401,7 +401,7 @@ void end_thr_alarm(my_bool free_structur
 {
   DBUG_ENTER("end_thr_alarm");
   if (alarm_aborted != 1)			/* If memory not freed */
-  {    
+  {
     pthread_mutex_lock(&LOCK_alarm);
     DBUG_PRINT("info",("Resheduling %d waiting alarms",alarm_queue.elements));
     alarm_aborted= -1;				/* mark aborted */
@@ -415,13 +415,10 @@ void end_thr_alarm(my_bool free_structur
     if (free_structures)
     {
       struct timespec abstime;
-      /*
-	The following test is just for safety, the caller should not
-	depend on this
-      */
+
       DBUG_ASSERT(!alarm_queue.elements);
-      /* Wait until alarm thread dies */
 
+      /* Wait until alarm thread dies */
       set_timespec(abstime, 10);		/* Wait up to 10 seconds */
       while (alarm_thread_running)
       {
@@ -429,16 +426,13 @@ void end_thr_alarm(my_bool free_structur
 	if (error == ETIME || error == ETIMEDOUT)
 	  break;				/* Don't wait forever */
       }
-      if (!alarm_queue.elements)
+      delete_queue(&alarm_queue);
+      alarm_aborted= 1;
+      pthread_mutex_unlock(&LOCK_alarm);
+      if (!alarm_thread_running)              /* Safety */
       {
-	delete_queue(&alarm_queue);
-	alarm_aborted= 1;
-	pthread_mutex_unlock(&LOCK_alarm);
-	if (!alarm_thread_running)		/* Safety */
-	{
-	  pthread_mutex_destroy(&LOCK_alarm);
-	  pthread_cond_destroy(&COND_alarm);
-	}
+        pthread_mutex_destroy(&LOCK_alarm);
+        pthread_cond_destroy(&COND_alarm);
       }
     }
     else

--- 1.30/server-tools/instance-manager/instance.cc	Tue Oct 25 16:26:15 2005
+++ 1.31/server-tools/instance-manager/instance.cc	Fri Dec 23 20:50:09 2005
@@ -255,7 +255,10 @@ static void start_and_monitor_instance(I
   log_info("starting instance %s", instance_name_buff);
 
   if (start_process(old_instance_options, &process_info))
+  {
+    instance_map->unlock();
     return;                                     /* error is logged */
+  }
 
   /* allow users to delete instances */
   instance_map->unlock();

--- 1.65/strings/decimal.c	Thu Nov 10 13:27:39 2005
+++ 1.66/strings/decimal.c	Fri Dec 23 20:50:09 2005
@@ -1069,9 +1069,9 @@ int decimal2longlong(decimal_t *from, lo
     }
   }
   /* boundary case: 9223372036854775808 */
-  if (unlikely(from->sign==0 && x < 0 && -x < 0))
+  if (unlikely(from->sign==0 && x == LONGLONG_MIN))
   {
-    *to= -1-x;
+    *to= LONGLONG_MAX;
     return E_DEC_OVERFLOW;
   }
 
@@ -2675,7 +2675,8 @@ void test_pr(const char *s1, int prec, i
   int slen= sizeof(s2);
   int res;
 
-  sprintf(s, "'%s', %d, %d, '%c'", s1, prec, dec, filler);
+  sprintf(s, filler ? "'%s', %d, %d, '%c'" : "'%s', %d, %d, '\\0'",
+          s1, prec, dec, filler);
   end= strend(s1);
   string2decimal(s1, &a, &end);
   res= decimal2string(&a, s2, &slen, prec, dec, filler);
Thread
bk commit into 5.0 tree (serg:1.1991)Sergei Golubchik23 Dec