MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:pekka Date:July 7 2006 11:40am
Subject:bk commit into 5.0 tree (pekka:1.2211)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of pekka. When pekka 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, 2006-07-07 13:40:47+02:00, pekka@stripped +7 -0
  Merge mysql.com:/space_old/pekka/ndb/version/my41-bug20847
  into  mysql.com:/space_old/pekka/ndb/version/my50-bug20847
  MERGE: 1.1616.2144.178

  BitKeeper/etc/config@stripped, 2006-07-07 13:37:47+02:00, pekka@stripped +0 -1
    auto
    MERGE: 1.10.1.8

  ndb/src/kernel/blocks/ERROR_codes.txt@stripped, 2006-07-07 13:39:25+02:00, pekka@stripped +2 -2
    manual
    MERGE: 1.8.1.10

  ndb/src/kernel/blocks/dbtup/Dbtup.hpp@stripped, 2006-07-07 13:39:40+02:00, pekka@stripped +0 -0
    SCCS merged
    MERGE: 1.16.1.5

  ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp@stripped, 2006-07-07 13:39:52+02:00, pekka@stripped +0 -0
    SCCS merged
    MERGE: 1.7.1.2

  ndb/test/ndbapi/testDict.cpp@stripped, 2006-07-07 13:40:05+02:00, pekka@stripped +0 -0
    SCCS merged
    MERGE: 1.18.1.1

  ndb/test/run-test/daily-basic-tests.txt@stripped, 2006-07-07 13:40:15+02:00, pekka@stripped +0 -0
    SCCS merged
    MERGE: 1.13.2.13

  sql/opt_range.cc@stripped, 2006-07-07 13:40:37+02:00, pekka@stripped +0 -0
    SCCS merged
    MERGE: 1.98.2.49

# 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:	pekka
# Host:	orca.ndb.mysql.com
# Root:	/space_old/pekka/ndb/version/my50-bug20847/RESYNC

--- 1.38/ndb/test/run-test/daily-basic-tests.txt	2006-07-07 13:41:02 +02:00
+++ 1.39/ndb/test/run-test/daily-basic-tests.txt	2006-07-07 13:41:02 +02:00
@@ -466,6 +466,10 @@
 
 max-time: 1500
 cmd: testDict
+args: -n CreateAndDropAtRandom -l 200 T1
+
+max-time: 1500
+cmd: testDict
 args: -n CreateAndDropWithData 
 
 max-time: 1500

--- 1.20/ndb/src/kernel/blocks/ERROR_codes.txt	2006-07-07 13:41:02 +02:00
+++ 1.21/ndb/src/kernel/blocks/ERROR_codes.txt	2006-07-07 13:41:02 +02:00
@@ -2,7 +2,7 @@
 Next NDBCNTR 1000
 Next NDBFS 2000
 Next DBACC 3002
-Next DBTUP 4013
+Next DBTUP 4014
 Next DBLQH 5043
 Next DBDICT 6007
 Next DBDIH 7177
@@ -436,6 +436,8 @@
 8035: Fail next trigger drop in TC
 8036: Fail next index drop in TC
 6006: Crash participant in create index
+
+4013: verify TUP tab descr before and after next DROP TABLE
 
 System Restart:
 ---------------

--- 1.26/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2006-07-07 13:41:02 +02:00
+++ 1.27/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2006-07-07 13:41:02 +02:00
@@ -2185,15 +2185,18 @@
 // Public methods
   Uint32 getTabDescrOffsets(const Tablerec* regTabPtr, Uint32* offset);
   Uint32 allocTabDescr(const Tablerec* regTabPtr, Uint32* offset);
-  void freeTabDescr(Uint32 retRef, Uint32 retNo);
+  void freeTabDescr(Uint32 retRef, Uint32 retNo, bool normal = true);
   Uint32 getTabDescrWord(Uint32 index);
   void setTabDescrWord(Uint32 index, Uint32 word);
 
 // Private methods
   Uint32 sizeOfReadFunction();
   void   removeTdArea(Uint32 tabDesRef, Uint32 list);
-  void   insertTdArea(Uint32 sizeOfChunk, Uint32 tabDesRef, Uint32 list);
-  Uint32 itdaMergeTabDescr(Uint32 retRef, Uint32 retNo);
+  void   insertTdArea(Uint32 tabDesRef, Uint32 list);
+  void   itdaMergeTabDescr(Uint32& retRef, Uint32& retNo, bool normal);
+#ifdef VM_TRACE
+  void verifytabdes();
+#endif
 
 //------------------------------------------------------------------------------------------------------
 // Page Memory Manager

--- 1.14/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp	2006-07-07 13:41:02 +02:00
+++ 1.15/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp	2006-07-07 13:41:02 +02:00
@@ -601,6 +601,9 @@
 Dbtup::execDROP_TAB_REQ(Signal* signal)
 {
   ljamEntry();
+  if (ERROR_INSERTED(4013)) {
+    verifytabdes();
+  }
   DropTabReq* req = (DropTabReq*)signal->getDataPtr();
   
   TablerecPtr tabPtr;
@@ -719,5 +722,9 @@
   
   releaseTabDescr(tabPtr.p);
   initTab(tabPtr.p);
+  if (ERROR_INSERTED(4013)) {
+    CLEAR_ERROR_INSERT_VALUE;
+    verifytabdes();
+  }
 }//Dbtup::execFSREMOVECONF()
 

--- 1.25/ndb/test/ndbapi/testDict.cpp	2006-07-07 13:41:03 +02:00
+++ 1.26/ndb/test/ndbapi/testDict.cpp	2006-07-07 13:41:03 +02:00
@@ -233,6 +233,101 @@
   return NDBT_OK;
 }
 
+int runCreateAndDropAtRandom(NDBT_Context* ctx, NDBT_Step* step)
+{
+  myRandom48Init(NdbTick_CurrentMillisecond());
+  Ndb* pNdb = GETNDB(step);
+  NdbDictionary::Dictionary* pDic = pNdb->getDictionary();
+  int loops = ctx->getNumLoops();
+  int numTables = NDBT_Tables::getNumTables();
+  bool* tabList = new bool [ numTables ];
+  int tabCount;
+
+  {
+    for (int num = 0; num < numTables; num++) {
+      (void)pDic->dropTable(NDBT_Tables::getTable(num)->getName());
+      tabList[num] = false;
+    }
+    tabCount = 0;
+  }
+
+  NdbRestarter restarter;
+  int result = NDBT_OK;
+  int bias = 1; // 0-less 1-more
+  int i = 0;
+  
+  while (i < loops) {
+    g_info << "loop " << i << " tabs " << tabCount << "/" << numTables << endl;
+    int num = myRandom48(numTables);
+    const NdbDictionary::Table* pTab = NDBT_Tables::getTable(num);
+    char tabName[200];
+    strcpy(tabName, pTab->getName());
+
+    if (tabList[num] == false) {
+      if (bias == 0 && myRandom48(100) < 80)
+        continue;
+      g_info << tabName << ": create" << endl;
+      if (pDic->createTable(*pTab) != 0) {
+        const NdbError err = pDic->getNdbError();
+        g_err << tabName << ": create failed: " << err << endl;
+        result = NDBT_FAILED;
+        break;
+      }
+      const NdbDictionary::Table* pTab2 = pDic->getTable(tabName);
+      if (pTab2 == NULL) {
+        const NdbError err = pDic->getNdbError();
+        g_err << tabName << ": verify create: " << err << endl;
+        result = NDBT_FAILED;
+        break;
+      }
+      tabList[num] = true;
+      assert(tabCount < numTables);
+      tabCount++;
+      if (tabCount == numTables)
+        bias = 0;
+    }
+    else {
+      if (bias == 1 && myRandom48(100) < 80)
+        continue;
+      g_info << tabName << ": drop" << endl;
+      if (restarter.insertErrorInAllNodes(4013) != 0) {
+        g_err << "error insert failed" << endl;
+        result = NDBT_FAILED;
+        break;
+      }
+      if (pDic->dropTable(tabName) != 0) {
+        const NdbError err = pDic->getNdbError();
+        g_err << tabName << ": drop failed: " << err << endl;
+        result = NDBT_FAILED;
+        break;
+      }
+      const NdbDictionary::Table* pTab2 = pDic->getTable(tabName);
+      if (pTab2 != NULL) {
+        g_err << tabName << ": verify drop: table exists" << endl;
+        result = NDBT_FAILED;
+        break;
+      }
+      if (pDic->getNdbError().code != 709 &&
+          pDic->getNdbError().code != 723) {
+        const NdbError err = pDic->getNdbError();
+        g_err << tabName << ": verify drop: " << err << endl;
+        result = NDBT_FAILED;
+        break;
+      }
+      tabList[num] = false;
+      assert(tabCount > 0);
+      tabCount--;
+      if (tabCount == 0)
+        bias = 1;
+    }
+    i++;
+  }
+
+  delete [] tabList;
+  return result;
+}
+
+
 int runCreateAndDropWithData(NDBT_Context* ctx, NDBT_Step* step){
   Ndb* pNdb = GETNDB(step);
   int loops = ctx->getNumLoops();
@@ -1848,6 +1943,12 @@
 TESTCASE("CreateAndDrop", 
 	 "Try to create and drop the table loop number of times\n"){
   INITIALIZER(runCreateAndDrop);
+}
+TESTCASE("CreateAndDropAtRandom",
+	 "Try to create and drop table at random loop number of times\n"
+         "Uses all available tables\n"
+         "Uses error insert 4013 to make TUP verify table descriptor"){
+  INITIALIZER(runCreateAndDropAtRandom);
 }
 TESTCASE("CreateAndDropWithData", 
 	 "Try to create and drop the table when it's filled with data\n"
Thread
bk commit into 5.0 tree (pekka:1.2211)pekka7 Jul