List:Commits« Previous MessageNext Message »
From:ramil Date:February 15 2008 12:03pm
Subject:bk commit into 5.0 tree (ramil:1.2570) BUG#33304
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ramil.  When ramil 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@stripped, 2008-02-15 16:03:54+04:00, ramil@stripped +1 -0
  Fix for bug #33304: Test 'func_group' hangs on Mac OS X 10.4 PowerPC 64-bit
  
  Problem: SLEEP(0) never returns on 64-bit Mac OS X due to a bug in 
  pthread_cond_timedwait().
  
  Fix: when given a very short timeout just return immediately.

  sql/item_func.cc@stripped, 2008-02-15 16:03:53+04:00, ramil@stripped +12 -0
    Fix for bug #33304: Test 'func_group' hangs on Mac OS X 10.4 PowerPC 64-bit
    
    - if given a very short timeout (< 10 mcs) just return from SLEEP().

diff -Nrup a/sql/item_func.cc b/sql/item_func.cc
--- a/sql/item_func.cc	2008-01-17 21:13:30 +04:00
+++ b/sql/item_func.cc	2008-02-15 16:03:53 +04:00
@@ -3729,6 +3729,18 @@ longlong Item_func_sleep::val_int()
   DBUG_ASSERT(fixed == 1);
 
   double time= args[0]->val_real();
+  /*
+    On 64-bit OSX pthread_cond_timedwait() waits forever
+    if passed abstime time has already been exceeded by 
+    the system time.
+    When given a very short timeout (< 10 mcs) just return 
+    immediately.
+    We assume that the lines between this test and the call 
+    to pthread_cond_timedwait() will be executed in less than 0.00001 sec.
+  */
+  if (time < 0.00001)
+    return 0;
+    
   set_timespec_nsec(abstime, (ulonglong)(time * ULL(1000000000)));
 
   pthread_cond_init(&cond, NULL);
Thread
bk commit into 5.0 tree (ramil:1.2570) BUG#33304ramil15 Feb