List:Commits« Previous MessageNext Message »
From:jonas Date:May 30 2008 10:03am
Subject:bk commit into 5.1 tree (jonas:1.2612) BUG#37092
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-05-30 10:03:55+02:00, jonas@stripped +4 -0
  ndb - bug#37092
        fix leaks/crashes that could occur in/after table-parse in master

  storage/ndb/src/kernel/blocks/ERROR_codes.txt@stripped, 2008-05-30 10:03:53+02:00,
jonas@stripped +5 -0
    new error codes

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2008-05-30 10:03:53+02:00,
jonas@stripped +42 -14
    ndb - bug#37092
      new error inserts for failed create table
      fix leaks/crashes that could occur

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp@stripped, 2008-05-30 10:03:53+02:00,
jonas@stripped +1 -0
    init to null

  storage/ndb/test/ndbapi/testDict.cpp@stripped, 2008-05-30 10:03:53+02:00,
jonas@stripped +3 -2
    new testcases

diff -Nrup a/storage/ndb/src/kernel/blocks/ERROR_codes.txt
b/storage/ndb/src/kernel/blocks/ERROR_codes.txt
--- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2008-04-25 09:11:27 +02:00
+++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2008-05-30 10:03:53 +02:00
@@ -551,6 +551,11 @@ Dbdict:
 6005 Crash in participant @ CreateTabReq::CreateDrop
 6007 Fail on readTableFile for READ_TAB_FILE1 (28770)
 
+6200 Set error code after handleTabInfoInit in master
+6201 Set error code after handleTabInfoInit in master (index)
+6202 Set error code before CREATE_FRAGMENTATION in master
+6203 Set error code before CREATE_FRAGMENTATION in master (index)
+
 Dbtup:
 4014 - handleInsert - Out of undo buffer
 4015 - handleInsert - Out of log space
diff -Nrup a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2008-05-29 17:58:53 +02:00
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2008-05-30 10:03:53 +02:00
@@ -2061,7 +2061,6 @@ Uint32 Dbdict::getFreeTableRecord(Uint32
   c_tableRecordPool.getPtr(tablePtr, i);
   ndbrequire(tablePtr.p->tabState == TableRecord::NOT_DEFINED);
   initialiseTableRecord(tablePtr);
-  tablePtr.p->tabState = TableRecord::DEFINING;
   return i;
 }
 
@@ -3959,10 +3958,26 @@ Dbdict::execCREATE_TABLE_REQ(Signal* sig
     
     handleTabInfoInit(r, &parseRecord);
     releaseSections(signal);
+
+    if (parseRecord.errorCode == 0)
+    {
+      if (ERROR_INSERTED(6200) ||
+          (ERROR_INSERTED(6201) && 
+           DictTabInfo::isIndex(parseRecord.tablePtr.p->tableType)))
+      {
+        CLEAR_ERROR_INSERT_VALUE;
+        parseRecord.errorCode = 1;
+      }
+    }
     
     if(parseRecord.errorCode != 0){
       jam();
       c_opCreateTable.release(createTabPtr);
+      if (!parseRecord.tablePtr.isNull())
+      {
+        jam();
+        releaseTableObject(parseRecord.tablePtr.i, true);
+      }
       break;
     }
     
@@ -4012,9 +4027,20 @@ Dbdict::execCREATE_TABLE_REQ(Signal* sig
       */
       parseRecord.tablePtr.p->primaryTableId = RNIL;
     }
-    EXECUTE_DIRECT(DBDIH, GSN_CREATE_FRAGMENTATION_REQ, signal,
-		   CreateFragmentationReq::SignalLength);
-    jamEntry();
+    if (ERROR_INSERTED(6202) || 
+        (ERROR_INSERTED(6203) && 
+         DictTabInfo::isIndex(parseRecord.tablePtr.p->tableType)))
+    {
+      CLEAR_ERROR_INSERT_VALUE;
+      signal->theData[0] = 1;
+    }
+    else
+    {
+      EXECUTE_DIRECT(DBDIH, GSN_CREATE_FRAGMENTATION_REQ, signal,
+                     CreateFragmentationReq::SignalLength);
+      jamEntry();
+    }
+    
     if (signal->theData[0] != 0)
     {
       jam();
@@ -6285,7 +6311,7 @@ Dbdict::execTC_SCHVERCONF(Signal* signal
     jam();    \
     parseP->errorCode = error; parseP->errorLine = __LINE__; \
     parseP->errorKey = it.getKey(); \
-    return;   \
+    return;                         \
   }//if
 
 // handleAddTableFailure(signal, __LINE__, allocatedTable);
@@ -6371,10 +6397,11 @@ void Dbdict::handleTabInfoInit(SimplePro
 
   if(checkExist){
     jam();
-    tabRequire(get_object(c_tableDesc.TableName, tableNameLength) == 0, 
-	       CreateTableRef::TableAlreadyExist);
+    
+    tabRequire(get_object(c_tableDesc.TableName, tableNameLength) == 0,
+               CreateTableRef::TableAlreadyExist;);
   }
-  
+
   TableRecordPtr tablePtr;
   switch (parseP->requestType) {
   case DictTabInfo::CreateTableFromAPI: {
@@ -6387,7 +6414,6 @@ void Dbdict::handleTabInfoInit(SimplePro
     // Check if no free tables existed.
     /* ---------------------------------------------------------------- */
     tabRequire(tablePtr.i != RNIL, CreateTableRef::NoMoreTableRecords);
-    
     c_tableRecordPool.getPtr(tablePtr);
     break;
   }
@@ -6422,21 +6448,20 @@ void Dbdict::handleTabInfoInit(SimplePro
 /* ---------------------------------------------------------------- */
     Uint32 tableVersion = c_tableDesc.TableVersion;
     tablePtr.p->tableVersion = tableVersion;
-    
+ 
     break;
   }
   default:
     ndbrequire(false);
     break;
   }//switch
-  parseP->tablePtr = tablePtr;
   
   { 
     Rope name(c_rope_pool, tablePtr.p->tableName);
     tabRequire(name.assign(c_tableDesc.TableName, tableNameLength, name_hash),
-	       CreateTableRef::OutOfStringBuffer);
+               CreateTableRef::OutOfStringBuffer);
   }
-
+  
   Ptr<DictObject> obj_ptr;
   if (parseP->requestType != DictTabInfo::AlterTableFromAPI) {
     jam();
@@ -6453,7 +6478,9 @@ void Dbdict::handleTabInfoInit(SimplePro
 	     c_tableDesc.TableName, tablePtr.i, tablePtr.p->m_obj_ptr_i);
 #endif
   }
-  
+  parseP->tablePtr = tablePtr;
+  tablePtr.p->tabState = TableRecord::DEFINING;
+
   // Disallow logging of a temporary table.
   tabRequire(!(c_tableDesc.TableTemporaryFlag && c_tableDesc.TableLoggedFlag),
              CreateTableRef::NoLoggingTemporaryTable);
@@ -6533,6 +6560,7 @@ void Dbdict::handleTabInfoInit(SimplePro
      * Release table
      */
     releaseTableObject(tablePtr.i, checkExist);
+    parseP->tablePtr.setNull();
     return;
   }
 
diff -Nrup a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2008-05-29 17:58:53 +02:00
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2008-05-30 10:03:53 +02:00
@@ -1125,6 +1125,7 @@ private:
    * Temporary structure used when parsing table info
    */
   struct ParseDictTabInfoRecord {
+    ParseDictTabInfoRecord() { tablePtr.setNull();}
     DictTabInfo::RequestType requestType;
     Uint32 errorCode;
     Uint32 errorLine;
diff -Nrup a/storage/ndb/test/ndbapi/testDict.cpp b/storage/ndb/test/ndbapi/testDict.cpp
--- a/storage/ndb/test/ndbapi/testDict.cpp	2008-05-29 17:58:53 +02:00
+++ b/storage/ndb/test/ndbapi/testDict.cpp	2008-05-30 10:03:53 +02:00
@@ -1972,9 +1972,10 @@ runCreateDiskTable(NDBT_Context* ctx, ND
 #include <NDBT_Tables.hpp>
 
 int runFailAddFragment(NDBT_Context* ctx, NDBT_Step* step){
-  static int acclst[] = { 3001 };
+  static int acclst[] = { 3001, 6200, 6202 };
   static int tuplst[] = { 4007, 4008, 4009, 4010, 4011, 4012 };
-  static int tuxlst[] = { 12001, 12002, 12003, 12004, 12005, 12006 };
+  static int tuxlst[] = { 12001, 12002, 12003, 12004, 12005, 12006, 
+                          6201, 6203 };
   static unsigned acccnt = sizeof(acclst)/sizeof(acclst[0]);
   static unsigned tupcnt = sizeof(tuplst)/sizeof(tuplst[0]);
   static unsigned tuxcnt = sizeof(tuxlst)/sizeof(tuxlst[0]);
Thread
bk commit into 5.1 tree (jonas:1.2612) BUG#37092jonas30 May