MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:pekka Date:February 3 2008 11:32am
Subject:bk commit into 5.1 tree (pekka:1.2706) BUG#33852
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 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, 2008-02-03 12:32:08+01:00, pekka@stripped +1 -0
  ndb - bug#33852 - count dynTabDescriptor in verifytabdes()

  storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp@stripped, 2008-02-03 12:31:07+01:00, pekka@stripped +41 -2
    bug#33852 - count dynTabDescriptor in verifytabdes()

diff -Nrup a/storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp	2007-04-03 14:49:02 +02:00
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp	2008-02-03 12:31:07 +01:00
@@ -247,7 +247,9 @@ Dbtup::verifytabdes()
     WordType() : fl(-1), ti(-1) {}
   };
   WordType* wt = new WordType [cnoOfTabDescrRec];
+  uint free_words = 0;
   uint free_frags = 0;
+  uint used_words = 0;
   // free lists
   {
     for (uint i = 0; i < 16; i++) {
@@ -278,6 +280,7 @@ Dbtup::verifytabdes()
         }
         desc2 = desc;
         desc = tableDescriptor[desc + ZTD_FL_NEXT].tabDescr;
+        free_words += (1 << i);
         free_frags++;
       }
     }
@@ -288,7 +291,9 @@ Dbtup::verifytabdes()
       TablerecPtr ptr;
       ptr.i = i;
       ptrAss(ptr, tablerec);
-      if (ptr.p->tableStatus == DEFINED) {
+      if (ptr.p->tableStatus != DEFINED)
+        continue;
+      {
         Uint32 offset[10];
         const Uint32 alloc = getTabDescrOffsets(ptr.p->m_no_of_attributes,
                                                 ptr.p->noOfCharsets,
@@ -315,6 +320,34 @@ Dbtup::verifytabdes()
           ndbrequire(wt[desc + j].ti == -1);
           wt[desc + j].ti = i;
         }
+        used_words += size;
+      }
+      {
+        Uint32 offset[3];
+        Uint32 MaskSize = (ptr.p->m_dyn_null_bits + 31) >> 5;
+        const Uint32 alloc = getDynTabDescrOffsets(MaskSize, offset);
+        const Uint32 desc = ptr.p->dynTabDescriptor;
+        Uint32 size = alloc;
+        if (size % ZTD_FREE_SIZE != 0)
+          size += ZTD_FREE_SIZE - size % ZTD_FREE_SIZE;
+        ndbrequire(desc + size <= cnoOfTabDescrRec);
+        { Uint32 index = desc + ZTD_FL_HEADER;
+          ndbrequire(tableDescriptor[index].tabDescr == ZTD_TYPE_NORMAL);
+        }
+        { Uint32 index = desc + ZTD_FL_SIZE;
+          ndbrequire(tableDescriptor[index].tabDescr == size);
+        }
+        { Uint32 index = desc + size - ZTD_TR_TYPE;
+          ndbrequire(tableDescriptor[index].tabDescr == ZTD_TYPE_NORMAL);
+        }
+        { Uint32 index = desc + size - ZTD_TR_SIZE;
+          ndbrequire(tableDescriptor[index].tabDescr == size);
+        }
+        for (uint j = 0; j < size; j++) {
+          ndbrequire(wt[desc + j].ti == -1);
+          wt[desc + j].ti = i;
+        }
+        used_words += size;
       }
     }
   }
@@ -327,6 +360,12 @@ Dbtup::verifytabdes()
     }
   }
   delete [] wt;
-  ndbout << "verifytabdes: frags=" << free_frags << endl;
+  ndbrequire(used_words + free_words == cnoOfTabDescrRec);
+  ndbout << "verifytabdes:"
+         << " total: " << cnoOfTabDescrRec
+         << " used: " << used_words
+         << " free: " << free_words
+         << " frags: " << free_frags
+         << endl;
 }
 #endif
Thread
bk commit into 5.1 tree (pekka:1.2706) BUG#33852pekka3 Feb