List:Commits« Previous MessageNext Message »
From:jonas Date:June 8 2006 1:43pm
Subject:bk commit into 5.1 tree (jonas:1.2389)
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
  1.2389 06/06/08 15:43:41 jonas@stripped +1 -0
  ndb - hugo
    Print (and optionally specify) random seed

  storage/ndb/test/src/NDBT_Test.cpp
    1.30 06/06/08 15:43:38 jonas@stripped +12 -0
    Print (and optionally specify) random seed

# 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-jonas

--- 1.29/storage/ndb/test/src/NDBT_Test.cpp	2005-11-07 12:19:09 +01:00
+++ 1.30/storage/ndb/test/src/NDBT_Test.cpp	2006-06-08 15:43:38 +02:00
@@ -1110,6 +1110,7 @@ static int opt_timer;
 static char * opt_remote_mgm = NULL;
 static char * opt_testname = NULL;
 static int opt_verbose;
+static int opt_seed = 0;
 
 static struct my_option my_long_options[] =
 {
@@ -1129,6 +1130,9 @@ static struct my_option my_long_options[
   { "loops", 'l', "Number of loops",
     (gptr*) &opt_loops, (gptr*) &opt_loops, 0,
     GET_INT, REQUIRED_ARG, 5, 0, 0, 0, 0, 0 },
+  { "seed", 1024, "Random seed",
+    (gptr*) &opt_seed, (gptr*) &opt_seed, 0,
+    GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
   { "testname", 'n', "Name of test to run",
     (gptr*) &opt_testname, (gptr*) &opt_testname, 0,
     GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
@@ -1224,6 +1228,14 @@ int NDBT_TestSuite::execute(int argc, co
   {
     return NDBT_ProgramExit(NDBT_FAILED);
   }
+
+  if (opt_seed == 0)
+  {
+    opt_seed = NdbTick_CurrentMillisecond();
+  }
+  ndbout_c("random seed: %u", opt_seed);
+  srand(opt_seed);
+  srandom(opt_seed);
   
   {
     Ndb ndb(&con, "TEST_DB");
Thread
bk commit into 5.1 tree (jonas:1.2389)jonas8 Jun