List:Commits« Previous MessageNext Message »
From:jonas Date:March 20 2008 3:15pm
Subject:bk commit into 5.1 tree (jonas:1.2547)
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, 2008-03-20 15:15:48+01:00, jonas@stripped +1 -0
  Make undosize changable by env-variable

  storage/ndb/test/src/NDBT_Tables.cpp@stripped, 2008-03-20 15:15:46+01:00,
jonas@stripped +17 -16
    Make undosize changable by env-variable

diff -Nrup a/storage/ndb/test/src/NDBT_Tables.cpp b/storage/ndb/test/src/NDBT_Tables.cpp
--- a/storage/ndb/test/src/NDBT_Tables.cpp	2008-03-20 14:46:49 +01:00
+++ b/storage/ndb/test/src/NDBT_Tables.cpp	2008-03-20 15:15:46 +01:00
@@ -16,6 +16,7 @@
 #include <NDBT.hpp>
 #include <NDBT_Table.hpp>
 #include <NDBT_Tables.hpp>
+#include <NdbEnv.h>
 
 /* ******************************************************* */
 //    Define Ndb standard tables 
@@ -745,28 +746,27 @@ NDBT_Tables::create_default_tablespace(N
       return NDBT_FAILED;
     }
   }
+
+  Uint32 mb = 96;
   {
-    NdbDictionary::Undofile uf = pDict->getUndofile(0, "undofile01.dat");
-    if (strcmp(uf.getPath(), "undofile01.dat") != 0)
+    char buf[256];
+    if (NdbEnv_GetEnv("UNDOSIZE", buf, sizeof(buf)))
     {
-      uf.setPath("undofile01.dat");
-      uf.setSize(32*1024*1024);
-      uf.setLogfileGroup("DEFAULT-LG");
-      
-      res = pDict->createUndofile(uf, true);
-      if(res != 0){
-	g_err << "Failed to create undofile:"
-	      << endl << pDict->getNdbError() << endl;
-	return NDBT_FAILED;
-      }
+      mb = atoi(buf);
+      ndbout_c("Using %umb dd-undo", mb);
     }
   }
+  
+  Uint32 sz = 32;
+  for (Uint32 i = 0; i * sz < mb; i++)
   {
-    NdbDictionary::Undofile uf = pDict->getUndofile(0, "undofile02.dat");
-    if (strcmp(uf.getPath(), "undofile02.dat") != 0)
+    char tmp[256];
+    BaseString::snprintf(tmp, sizeof(tmp), "undofile%u.dat", i);
+    NdbDictionary::Undofile uf = pDict->getUndofile(0, tmp);
+    if (strcmp(uf.getPath(), tmp) != 0)
     {
-      uf.setPath("undofile02.dat");
-      uf.setSize(32*1024*1024);
+      uf.setPath(tmp);
+      uf.setSize(sz*1024*1024);
       uf.setLogfileGroup("DEFAULT-LG");
       
       res = pDict->createUndofile(uf, true);
@@ -777,6 +777,7 @@ NDBT_Tables::create_default_tablespace(N
       }
     }
   }
+
   NdbDictionary::Tablespace ts = pDict->getTablespace("DEFAULT-TS");
   if (strcmp(ts.getName(), "DEFAULT-TS") != 0)
   {
Thread
bk commit into 5.1 tree (jonas:1.2547)jonas20 Mar 2008