List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:August 20 2008 10:29pm
Subject:bzr commit into mysql-5.1 branch (jonas:2653) Bug#34216
View as plain text  
#At file:///home/jonas/src/telco-6.2/

 2653 Jonas Oreland	2008-08-20
      ndb - fix testNodeRestart -n Bug34216
modified:
  storage/ndb/test/ndbapi/testNodeRestart.cpp

=== modified file 'storage/ndb/test/ndbapi/testNodeRestart.cpp'
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp	2008-04-25 07:14:29 +0000
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp	2008-08-20 20:29:47 +0000
@@ -2180,21 +2180,33 @@ runBug34216(NDBT_Context* ctx, NDBT_Step
       break;
     }
 
-    int rows = 10;
+    int rows = 25;
+    if (rows > records)
+      rows = records;
+
     int batch = 1;
     int row = (records - rows) ? rand() % (records - rows) : 0;
+    if (row + rows > records)
+      row = records - row;
 
-    if(hugoOps.pkUpdateRecord(pNdb, row, batch, rand()) != 0)
-      goto err;
-
-    for (int l = 1; l<5; l++)
+    /**
+     * We should really somehow check that one of the 25 rows
+     *   resides in the node we're targeting
+     */
+    for (int r = row; r < row + rows; r++)
     {
-      if (hugoOps.execute_NoCommit(pNdb) != 0)
+      if(hugoOps.pkUpdateRecord(pNdb, r, batch, rand()) != 0)
         goto err;
-
-      if(hugoOps.pkUpdateRecord(pNdb, row, batch, rand()) != 0)
-        goto err;
-    }
+      
+      for (int l = 1; l<5; l++)
+      {
+        if (hugoOps.execute_NoCommit(pNdb) != 0)
+          goto err;
+        
+        if(hugoOps.pkUpdateRecord(pNdb, r, batch, rand()) != 0)
+          goto err;
+      }
+    }      
 
     hugoOps.execute_Commit(pNdb);
     hugoOps.closeTransaction(pNdb);

Thread
bzr commit into mysql-5.1 branch (jonas:2653) Bug#34216Jonas Oreland20 Aug