List:Commits« Previous MessageNext Message »
From:jonas Date:March 8 2007 4:06pm
Subject:bk commit into 5.1 tree (jonas:1.2429)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas 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, 2007-03-08 17:06:04+01:00, jonas@stripped +2 -0
  ndb -
    fix test_event -n EventOperationApplier

  storage/ndb/test/ndbapi/test_event.cpp@stripped, 2007-03-08 17:06:02+01:00, jonas@stripped +11 -3
    fix potential race

  storage/ndb/test/src/HugoCalculator.cpp@stripped, 2007-03-08 17:06:02+01:00, jonas@stripped +23 -2
    generate longer varsize keys

# 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:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/51-work

--- 1.23/storage/ndb/test/ndbapi/test_event.cpp	2007-03-08 17:06:09 +01:00
+++ 1.24/storage/ndb/test/ndbapi/test_event.cpp	2007-03-08 17:06:09 +01:00
@@ -500,6 +500,12 @@
   int records = ctx->getNumRecords();
   HugoTransactions hugoTrans(*ctx->getTab());
   
+  if(ctx->getPropertyWait("LastGCI", ~(Uint32)0))
+  {
+    g_err << "FAIL " << __LINE__ << endl;
+    return NDBT_FAILED;
+  }
+
   while(loops -- && !ctx->isTestStopped())
   {
     hugoTrans.clearTable(GETNDB(step), 0);
@@ -606,9 +612,11 @@
     goto end;
   }
 
+  ctx->setProperty("LastGCI", ~(Uint32)0);
+  ctx->broadcast();
+
   while(!ctx->isTestStopped())
   {
-    int r;
     int count= 0;
     Uint32 stop_gci= ~0;
     Uint64 curr_gci = 0;
@@ -778,7 +786,7 @@
 
 	  if (trans->getNdbError().status == NdbError::PermanentError)
 	  {
-	    g_err << "Ignoring execute " << r << " failed "
+	    g_err << "Ignoring execute failed "
 		  << trans->getNdbError().code << " "
 		  << trans->getNdbError().message << endl;
 	  
@@ -788,7 +796,7 @@
 	  }
 	  else if (noRetries++ == 10)
 	  {
-	    g_err << "execute " << r << " failed "
+	    g_err << "execute failed "
 		  << trans->getNdbError().code << " "
 		  << trans->getNdbError().message << endl;
 	    trans->close();

--- 1.23/storage/ndb/test/src/HugoCalculator.cpp	2007-03-08 17:06:09 +01:00
+++ 1.24/storage/ndb/test/src/HugoCalculator.cpp	2007-03-08 17:06:09 +01:00
@@ -89,6 +89,27 @@
 HugoCalculator::double calcValue(int record, int attrib, int updates) const;
 #endif
 
+static
+Uint32
+calc_len(Uint32 rvalue, int maxlen)
+{
+  Uint32 minlen = 25;
+  
+  if ((rvalue >> 16) < 4096)
+    minlen = 15;
+  else if ((rvalue >> 16) < 8192)
+    minlen = 25;
+  else if ((rvalue >> 16) < 16384)
+    minlen = 35;
+  else
+    minlen = 64;
+
+  if (maxlen <= minlen)
+    return maxlen;
+
+  return minlen + (rvalue % (maxlen - minlen));
+}
+
 const char* 
 HugoCalculator::calcValue(int record, 
 			  int attrib, 
@@ -178,7 +199,7 @@
     break;
   case NdbDictionary::Column::Varbinary:
   case NdbDictionary::Column::Varchar:
-    len = 1 + (myRand(&seed) % (len - 1));
+    len = calc_len(myRand(&seed), len - 1);
     assert(len < 256);
     * outlen = len + 1;
     * buf = len;
@@ -186,7 +207,7 @@
     goto write_char;
   case NdbDictionary::Column::Longvarchar:
   case NdbDictionary::Column::Longvarbinary:
-    len = 1 + (myRand(&seed) % (len - 2));
+    len = calc_len(myRand(&seed), len - 2);
     assert(len < 65536);
     * outlen = len + 2;
     int2store(buf, len);
Thread
bk commit into 5.1 tree (jonas:1.2429)jonas8 Mar