List:Commits« Previous MessageNext Message »
From:Pekka Nousiainen Date:May 30 2011 8:24am
Subject:bzr commit into mysql-5.1-telco-7.0-wl4124-new0 branch
(pekka.nousiainen:4387) WL#4124
View as plain text  
#At file:///export/space/pekka/ms/ms-wl4124-70/ based on revid:pekka.nousiainen@stripped

 4387 Pekka Nousiainen	2011-05-30
      wl#4124 d03_systab.diff
      revert NDBCNTR and use TRIX

    modified:
      storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp
      storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
      storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
      storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp
      storage/ndb/src/kernel/blocks/trix/Trix.cpp
      storage/ndb/src/kernel/blocks/trix/Trix.hpp
=== modified file 'storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp'
--- a/storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp	2011-05-19 09:16:32 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp	2011-05-30 08:24:14 +0000
@@ -117,18 +117,6 @@ public:
     bool keyFlag;
     bool nullable;
   };
-  struct SysIndex {
-    const char* name;
-    Uint32 columnCount;
-    Uint32 columnList[4];
-    // DictTabInfo
-    DictTabInfo::TableType indexType;
-    bool indexLoggedFlag;
-    // saved id (initially set only at creating node)
-    mutable Uint32 tableId;
-    mutable Uint32 indexId;
-    mutable Uint32 indexVersion;
-  };
   struct SysTable {
     const char* name;
     unsigned columnCount;
@@ -137,21 +125,27 @@ public:
     DictTabInfo::TableType tableType;
     DictTabInfo::FragmentType fragmentType;
     bool tableLoggedFlag;
-    // indexes
-    Uint32 indexCount;
-    const SysIndex** indexList;
-    // saved id (initially set only at creating node)
+    // saved table id
     mutable Uint32 tableId;
     mutable Uint32 tableVersion;
   };
+  struct SysIndex {
+    const char* name;
+    const SysTable* primaryTable;
+    Uint32 columnCount;
+    Uint32 columnList[4];
+    // DictTabInfo
+    DictTabInfo::TableType indexType;
+    DictTabInfo::FragmentType fragmentType;
+    bool indexLoggedFlag;
+    // saved index table id
+    mutable Uint32 indexId;
+  };
   static const SysTable* g_sysTableList[];
   static const unsigned g_sysTableCount;
   // the system tables
   static const SysTable g_sysTable_SYSTAB_0;
   static SysTable g_sysTable_NDBEVENTS_0;
-  static const SysTable g_sysTable_NDBIS_HEAD;
-  static const SysTable g_sysTable_NDBIS_SAMPLE;
-  static const SysIndex g_sysIndex_NDBIS_SAMPLE_X1;
   // schema trans
   Uint32 c_schemaTransId;
   Uint32 c_schemaTransKey;
@@ -201,8 +195,6 @@ private:
   void execSCHEMA_TRANS_END_REF(Signal* signal);
   void execCREATE_TABLE_REF(Signal* signal);
   void execCREATE_TABLE_CONF(Signal* signal);
-  void execCREATE_INDX_REF(Signal* signal);
-  void execCREATE_INDX_CONF(Signal* signal);
   void execCREATE_HASH_MAP_REF(Signal* signal);
   void execCREATE_HASH_MAP_CONF(Signal* signal);
   void execCREATE_FILEGROUP_REF(Signal* signal);
@@ -252,8 +244,7 @@ private:
   void systemErrorLab(Signal* signal, int line);
 
   void createHashMap(Signal*, Uint32 index);
-  void createSystableLab(Signal* signal, Uint32 ti);
-  void createSysindexLab(Signal* signal, Uint32 ti, Uint32 xi);
+  void createSystableLab(Signal* signal, unsigned index);
   void createDDObjects(Signal*, unsigned index);
   void crSystab7Lab(Signal* signal);
   void crSystab8Lab(Signal* signal);

=== modified file 'storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp	2011-05-19 09:16:32 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp	2011-05-30 08:24:14 +0000
@@ -87,8 +87,6 @@ Ndbcntr::Ndbcntr(Block_context& ctx):
   addRecSignal(GSN_SCHEMA_TRANS_END_REF, &Ndbcntr::execSCHEMA_TRANS_END_REF);
   addRecSignal(GSN_CREATE_TABLE_REF, &Ndbcntr::execCREATE_TABLE_REF);
   addRecSignal(GSN_CREATE_TABLE_CONF, &Ndbcntr::execCREATE_TABLE_CONF);
-  addRecSignal(GSN_CREATE_INDX_REF, &Ndbcntr::execCREATE_INDX_REF);
-  addRecSignal(GSN_CREATE_INDX_CONF, &Ndbcntr::execCREATE_INDX_CONF);
   addRecSignal(GSN_CREATE_HASH_MAP_REF, &Ndbcntr::execCREATE_HASH_MAP_REF);
   addRecSignal(GSN_CREATE_HASH_MAP_CONF, &Ndbcntr::execCREATE_HASH_MAP_CONF);
   addRecSignal(GSN_CREATE_FILEGROUP_REF, &Ndbcntr::execCREATE_FILEGROUP_REF);

=== modified file 'storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2011-05-19 09:16:32 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2011-05-30 08:24:14 +0000
@@ -24,7 +24,6 @@
 #include <signaldata/DictTabInfo.hpp>
 #include <signaldata/SchemaTrans.hpp>
 #include <signaldata/CreateTable.hpp>
-#include <signaldata/CreateIndx.hpp>
 #include <signaldata/CreateHashMap.hpp>
 #include <signaldata/ReadNodesConf.hpp>
 #include <signaldata/NodeFailRep.hpp>
@@ -2407,16 +2406,16 @@ Ndbcntr::execCREATE_FILE_CONF(Signal* si
   createDDObjects(signal, conf->senderData + 1);
 }
 
-void Ndbcntr::createSystableLab(Signal* signal, Uint32 ti)
+void Ndbcntr::createSystableLab(Signal* signal, unsigned index)
 {
-  if (ti >= g_sysTableCount) {
-    ndbassert(ti == g_sysTableCount);
+  if (index >= g_sysTableCount) {
+    ndbassert(index == g_sysTableCount);
     createDDObjects(signal, 0);
     return;
   }
-  const SysTable& table = *g_sysTableList[ti];
-  Uint32 propPage[1024];
-  LinearWriter w(propPage, 1024);
+  const SysTable& table = *g_sysTableList[index];
+  Uint32 propPage[256];
+  LinearWriter w(propPage, 256);
 
   // XXX remove commented-out lines later
 
@@ -2437,8 +2436,7 @@ void Ndbcntr::createSystableLab(Signal*
   w.add(DictTabInfo::HashMapObjectId, c_hashMapId);
   w.add(DictTabInfo::HashMapVersion, c_hashMapVersion);
 
-  Uint32 i;
-  for (i = 0; i < table.columnCount; i++) {
+  for (unsigned i = 0; i < table.columnCount; i++) {
     const SysColumn& column = table.columnList[i];
     ndbassert(column.pos == i);
     w.add(DictTabInfo::AttributeName, column.name);
@@ -2447,13 +2445,11 @@ void Ndbcntr::createSystableLab(Signal*
     w.add(DictTabInfo::AttributeStorageType, 
 	  (Uint32)NDB_STORAGETYPE_MEMORY);
     switch(column.type){
-    case DictTabInfo::ExtVarchar:
     case DictTabInfo::ExtVarbinary:
       jam();
       w.add(DictTabInfo::AttributeArrayType,
             (Uint32)NDB_ARRAYTYPE_SHORT_VAR);
       break;
-    case DictTabInfo::ExtLongvarchar:
     case DictTabInfo::ExtLongvarbinary:
       jam();
       w.add(DictTabInfo::AttributeArrayType,
@@ -2479,12 +2475,10 @@ void Ndbcntr::createSystableLab(Signal*
 
   CreateTableReq* const req = (CreateTableReq*)signal->getDataPtrSend();
   req->clientRef = reference();
-  req->clientData = ti;
+  req->clientData = index;
   req->requestInfo = 0;
   req->transId = c_schemaTransId;
   req->transKey = c_schemaTransKey;
-
-  D("create table" << V(ti) << V(table.name));
   sendSignal(DBDICT_REF, GSN_CREATE_TABLE_REQ, signal,
 	     CreateTableReq::SignalLength, JBB, ptr, 1);
   return;
@@ -2493,9 +2487,6 @@ void Ndbcntr::createSystableLab(Signal*
 void Ndbcntr::execCREATE_TABLE_REF(Signal* signal) 
 {
   jamEntry();
-  const CreateTableRef* ref = (const CreateTableRef*)signal->getDataPtr();
-  ndbout << "CreateTableRef" << " errorCode=" << ref->errorCode
-         << " errorLine=" << ref->errorLine << endl;
   progError(__LINE__,NDBD_EXIT_NDBREQUIRE, "CREATE_TABLE_REF");
   return;
 }//Ndbcntr::execDICTTABREF()
@@ -2504,92 +2495,14 @@ void Ndbcntr::execCREATE_TABLE_CONF(Sign
 {
   jamEntry();
   const CreateTableConf* conf = (const CreateTableConf*)signal->getDataPtr();
+  //csystabId = conf->tableId;
   ndbrequire(conf->transId == c_schemaTransId);
-  const Uint32 ti = conf->clientData;
-  ndbrequire(ti < g_sysTableCount);
-  const SysTable& table = *g_sysTableList[ti];
+  ndbrequire(conf->senderData < g_sysTableCount);
+  const SysTable& table = *g_sysTableList[conf->senderData];
   table.tableId = conf->tableId;
   table.tableVersion = conf->tableVersion;
-  createSysindexLab(signal, ti, 0);
-  return;
-}//Ndbcntr::execDICTTABCONF()
-
-void Ndbcntr::createSysindexLab(Signal* signal, Uint32 ti, Uint32 xi)
-{
-  ndbrequire(ti < g_sysTableCount);
-  const SysTable& table = *g_sysTableList[ti];
-  if (xi >= table.indexCount) {
-    ndbassert(xi == table.indexCount);
-    createSystableLab(signal, ti + 1);
-    return;
-  }
-
-  ndbrequire(table.indexList[xi] != 0);
-  const SysIndex& index = *table.indexList[xi];
-  CreateIndxReq* const req = (CreateIndxReq*)signal->getDataPtrSend();
-  req->clientRef = reference();
-  req->clientData = ti | (xi << 8);
-  req->transId = c_schemaTransId;
-  req->transKey = c_schemaTransKey;
-  req->requestInfo = 0;
-  req->tableId = table.tableId;
-  req->tableVersion = table.tableVersion;
-  req->indexType = index.indexType;
-  req->online = 1;
-
-  LinearSectionPtr ptr[3];
-
-  Uint32 attr[1 + 32];
-  attr[0] = index.columnCount;
-  memcpy(&attr[1], index.columnList, index.columnCount * 4);
-  ptr[0].p = attr;
-  ptr[0].sz = 1 + index.columnCount;
-
-  Uint32 propPage[256];
-  LinearWriter w(propPage, 256);
-  w.first();
-  char name[MAX_TAB_NAME_SIZE];
-  sprintf(name, index.name, table.tableId);
-  w.add(DictTabInfo::TableName, name);
-  w.add(DictTabInfo::TableLoggedFlag, index.indexLoggedFlag);
-  w.add(DictTabInfo::TableEnd, (Uint32)true);
-  Uint32 length = w.getWordsUsed();
-  ptr[1].p = &propPage[0];
-  ptr[1].sz = length;
-
-  D("create index" << V(ti) << V(xi) << V(name));
-  sendSignal(DBDICT_REF, GSN_CREATE_INDX_REQ, signal,
-             CreateIndxReq::SignalLength, JBB, ptr, 2);
-}
-
-void Ndbcntr::execCREATE_INDX_REF(Signal* signal)
-{
-  jamEntry();
-  const CreateIndxRef* ref = (const CreateIndxRef*)signal->getDataPtr();
-  ndbout << "CreateIndxRef" << " errorCode=" << ref->errorCode
-         << " errorLine=" << ref->errorLine << endl;
-  progError(__LINE__,NDBD_EXIT_NDBREQUIRE, "CREATE_INDX_REF");
-  return;
-}//Ndbcntr::execDICTTABREF()
-
-void Ndbcntr::execCREATE_INDX_CONF(Signal* signal)
-{
-  jamEntry();
-  const CreateIndxConf* conf = (const CreateIndxConf*)signal->getDataPtr();
-  ndbrequire(conf->transId == c_schemaTransId);
-
-  const Uint32 ti = conf->clientData & 0xFF;
-  const Uint32 xi = conf->clientData >> 8;
-  ndbrequire(ti < g_sysTableCount);
-  const SysTable& table = *g_sysTableList[ti];
-  ndbrequire(xi < table.indexCount);
-  ndbrequire(table.indexList[xi] != 0);
-  const SysIndex& index = *table.indexList[xi];
-
-  index.tableId = table.tableId;
-  index.indexId = conf->indexId;
-  index.indexVersion = conf->indexVersion;
-  createSysindexLab(signal, ti, xi + 1);
+  createSystableLab(signal, conf->senderData + 1);
+  //startInsertTransactions(signal);
   return;
 }//Ndbcntr::execDICTTABCONF()
 

=== modified file 'storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp	2011-05-30 08:22:11 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp	2011-05-30 08:24:14 +0000
@@ -39,7 +39,7 @@ Ndbcntr::g_sysTable_SYSTAB_0 = {
   arrayLength(column_SYSTAB_0), column_SYSTAB_0,
   DictTabInfo::SystemTable,
   DictTabInfo::HashMapPartition,
-  true, 0, 0, ~0, ~0
+  true, ~0, ~0
 };
 
 // NDB$EVENTS_0
@@ -90,113 +90,7 @@ Ndbcntr::g_sysTable_NDBEVENTS_0 = {
   arrayLength(column_NDBEVENTS_0), column_NDBEVENTS_0,
   DictTabInfo::SystemTable,
   DictTabInfo::HashMapPartition,
-  true, 0, 0, ~0, ~0
-};
-
-// NDB$IS_HEAD
-
-static const Ndbcntr::SysColumn
-column_NDBIS_HEAD[] = {
-  // key must be first
-  { 0, "INDEX_ID",
-    DictTabInfo::ExtUnsigned, 1,
-    true, false
-  },
-  { 1, "INDEX_VERSION",
-    DictTabInfo::ExtUnsigned, 1,
-    true, false
-  },
-  // table
-  { 2, "TABLE_ID",
-    DictTabInfo::ExtUnsigned, 1,
-    false, false
-  },
-  { 3, "FRAG_COUNT",
-    DictTabInfo::ExtUnsigned, 1,
-    false, false
-  },
-  { 4, "VALUE_FORMAT",
-    DictTabInfo::ExtUnsigned, 1,
-    false, false
-  },
-  // current sample
-  { 5, "SAMPLE_VERSION",
-    DictTabInfo::ExtUnsigned, 1,
-    false, false
-  },
-  { 6, "LOAD_TIME",
-    DictTabInfo::ExtUnsigned, 1,
-    false, false
-  },
-  { 7, "SAMPLE_COUNT",
-    DictTabInfo::ExtUnsigned, 1,
-    false, false
-  },
-  { 8, "KEY_BYTES",
-    DictTabInfo::ExtUnsigned, 1,
-    false, false
-  }
-};
-
-const Ndbcntr::SysTable
-Ndbcntr::g_sysTable_NDBIS_HEAD = {
-  "sys/def/NDB$IS_HEAD",
-  arrayLength(column_NDBIS_HEAD), column_NDBIS_HEAD,
-  DictTabInfo::SystemTable,
-  DictTabInfo::HashMapPartition,
-  true, 0, 0, ~0, ~0
-};
-
-// NDB$IS_SAMPLE
-
-static const Ndbcntr::SysColumn
-column_NDBIS_SAMPLE[] = {
-  // key must be first
-  { 0, "INDEX_ID",
-    DictTabInfo::ExtUnsigned, 1,
-    true, false
-  },
-  { 1, "INDEX_VERSION",
-    DictTabInfo::ExtUnsigned, 1,
-    true, false
-  },
-  { 2, "SAMPLE_VERSION",
-    DictTabInfo::ExtUnsigned, 1,
-    true, false
-  },
-  { 3, "STAT_KEY",
-    DictTabInfo::ExtLongvarbinary, MAX_INDEX_STAT_KEY_SIZE * 4,
-    true, false
-  },
-  // value
-  { 4, "STAT_VALUE",
-    DictTabInfo::ExtLongvarbinary, MAX_INDEX_STAT_VALUE_CSIZE * 4,
-    false, false
-  }
-};
-
-const Ndbcntr::SysIndex
-Ndbcntr::g_sysIndex_NDBIS_SAMPLE_X1 = {
-    "sys/def/%u/NDB$IS_SAMPLE_X1",
-    3, { 0, 1, 2, ~0 },
-    DictTabInfo::OrderedIndex,
-    false, ~0, ~0, ~0
-};
-
-static const Ndbcntr::SysIndex*
-index_NDBIS_SAMPLE[] = {
-  &Ndbcntr::g_sysIndex_NDBIS_SAMPLE_X1
-};
-
-const Ndbcntr::SysTable
-Ndbcntr::g_sysTable_NDBIS_SAMPLE = {
-  "sys/def/NDB$IS_SAMPLE",
-  arrayLength(column_NDBIS_SAMPLE), column_NDBIS_SAMPLE,
-  DictTabInfo::SystemTable,
-  DictTabInfo::HashMapPartition,
-  true,
-  arrayLength(index_NDBIS_SAMPLE), index_NDBIS_SAMPLE,
-  ~0, ~0
+  true, ~0, ~0
 };
 
 // all

=== modified file 'storage/ndb/src/kernel/blocks/trix/Trix.cpp'
--- a/storage/ndb/src/kernel/blocks/trix/Trix.cpp	2011-05-30 08:22:11 +0000
+++ b/storage/ndb/src/kernel/blocks/trix/Trix.cpp	2011-05-30 08:24:14 +0000
@@ -116,9 +116,6 @@ Trix::Trix(Block_context& ctx) :
 
   // index stats sys tables
   c_statGetMetaDone = false;
-  c_statMetaHead = &Ndbcntr::g_sysTable_NDBIS_HEAD;
-  c_statMetaSample = &Ndbcntr::g_sysTable_NDBIS_SAMPLE;
-  c_statMetaSampleX1 = &Ndbcntr::g_sysIndex_NDBIS_SAMPLE_X1;
 }
 
 /**
@@ -1695,6 +1692,79 @@ Trix::execINDEX_STAT_IMPL_REQ(Signal* si
 
 // sys tables metadata
 
+const Trix::SysColumn
+Trix::g_statMetaHead_column[] = {
+  { 0, "INDEX_ID",
+    true
+  },
+  { 1, "INDEX_VERSION",
+    true
+  },
+  { 2, "TABLE_ID",
+    false
+  },
+  { 3, "FRAG_COUNT",
+    false
+  },
+  { 4, "VALUE_FORMAT",
+    false
+  },
+  { 5, "SAMPLE_VERSION",
+    false
+  },
+  { 6, "LOAD_TIME",
+    false
+  },
+  { 7, "SAMPLE_COUNT",
+    false
+  },
+  { 8, "KEY_BYTES",
+    false
+  }
+};
+
+const Trix::SysColumn
+Trix::g_statMetaSample_column[] = {
+  { 0, "INDEX_ID",
+    true
+  },
+  { 1, "INDEX_VERSION",
+    true
+  },
+  { 2, "SAMPLE_VERSION",
+    true
+  },
+  { 3, "STAT_KEY",
+    true
+  },
+  { 4, "STAT_VALUE",
+    false
+  }
+};
+
+const Trix::SysTable
+Trix::g_statMetaHead = {
+  "sys/def/NDB$IS_HEAD",
+  ~(Uint32)0,
+  sizeof(g_statMetaHead_column)/sizeof(g_statMetaHead_column[0]),
+  g_statMetaHead_column
+};
+
+const Trix::SysTable
+Trix::g_statMetaSample = {
+  "sys/def/NDB$IS_SAMPLE",
+  ~(Uint32)0,
+  sizeof(g_statMetaSample_column)/sizeof(g_statMetaSample_column[0]),
+  g_statMetaSample_column
+};
+
+const Trix::SysIndex
+Trix::g_statMetaSampleX1 = {
+  "sys/def/%u/NDB$IS_SAMPLE_X1",
+  ~(Uint32)0,
+  ~(Uint32)0
+};
+
 void
 Trix::statMetaGetHead(Signal* signal, StatOp& stat)
 {
@@ -1702,7 +1772,7 @@ Trix::statMetaGetHead(Signal* signal, St
   StatOp::Meta& meta = stat.m_meta;
   meta.m_cb.m_callbackFunction = safe_cast(&Trix::statMetaGetHeadCB);
   meta.m_cb.m_callbackData = stat.m_ownPtrI;
-  const char* name = Ndbcntr::g_sysTable_NDBIS_HEAD.name;
+  const char* name = g_statMetaHead.name;
   sendGetTabInfoReq(signal, stat, name);
 }
 
@@ -1718,7 +1788,7 @@ Trix::statMetaGetHeadCB(Signal* signal,
     statOpError(signal, stat, ret, __LINE__);
     return;
   }
-  c_statMetaHead->tableId = meta.m_conf.tableId;
+  g_statMetaHead.tableId = meta.m_conf.tableId;
   statMetaGetSample(signal, stat);
 }
 
@@ -1729,7 +1799,7 @@ Trix::statMetaGetSample(Signal* signal,
   StatOp::Meta& meta = stat.m_meta;
   meta.m_cb.m_callbackFunction = safe_cast(&Trix::statMetaGetSampleCB);
   meta.m_cb.m_callbackData = stat.m_ownPtrI;
-  const char* name = Ndbcntr::g_sysTable_NDBIS_SAMPLE.name;
+  const char* name = g_statMetaSample.name;
   sendGetTabInfoReq(signal, stat, name);
 }
 
@@ -1745,7 +1815,7 @@ Trix::statMetaGetSampleCB(Signal* signal
     statOpError(signal, stat, ret, __LINE__);
     return;
   }
-  c_statMetaSample->tableId = meta.m_conf.tableId;
+  g_statMetaSample.tableId = meta.m_conf.tableId;
   statMetaGetSampleX1(signal, stat);
 }
 
@@ -1756,9 +1826,9 @@ Trix::statMetaGetSampleX1(Signal* signal
   StatOp::Meta& meta = stat.m_meta;
   meta.m_cb.m_callbackFunction = safe_cast(&Trix::statMetaGetSampleX1CB);
   meta.m_cb.m_callbackData = stat.m_ownPtrI;
-  const char* name_fmt = Ndbcntr::g_sysIndex_NDBIS_SAMPLE_X1.name;
+  const char* name_fmt = g_statMetaSampleX1.name;
   char name[MAX_TAB_NAME_SIZE];
-  BaseString::snprintf(name, sizeof(name), name_fmt, c_statMetaSample->tableId);
+  BaseString::snprintf(name, sizeof(name), name_fmt, g_statMetaSample.tableId);
   sendGetTabInfoReq(signal, stat, name);
 }
 
@@ -1774,8 +1844,8 @@ Trix::statMetaGetSampleX1CB(Signal* sign
     statOpError(signal, stat, ret, __LINE__);
     return;
   }
-  c_statMetaSampleX1->tableId = c_statMetaSample->tableId;
-  c_statMetaSampleX1->indexId = meta.m_conf.tableId;
+  g_statMetaSampleX1.tableId = g_statMetaSample.tableId;
+  g_statMetaSampleX1.indexId = meta.m_conf.tableId;
   statGetMetaDone(signal, stat);
 }
 
@@ -1872,7 +1942,7 @@ Trix::statHeadRead(Signal* signal, StatO
   util.m_not_found = false;
   util.m_cb.m_callbackFunction = safe_cast(&Trix::statHeadReadCB);
   util.m_cb.m_callbackData = stat.m_ownPtrI;
-  send.m_sysTable = c_statMetaHead;
+  send.m_sysTable = &g_statMetaHead;
   send.m_operationType = UtilPrepareReq::Read;
   statUtilPrepare(signal, stat);
 }
@@ -1899,7 +1969,7 @@ Trix::statHeadInsert(Signal* signal, Sta
 
   util.m_cb.m_callbackFunction = safe_cast(&Trix::statHeadInsertCB);
   util.m_cb.m_callbackData = stat.m_ownPtrI;
-  send.m_sysTable = c_statMetaHead;
+  send.m_sysTable = &g_statMetaHead;
   send.m_operationType = UtilPrepareReq::Insert;
   statUtilPrepare(signal, stat);
 }
@@ -1923,7 +1993,7 @@ Trix::statHeadUpdate(Signal* signal, Sta
 
   util.m_cb.m_callbackFunction = safe_cast(&Trix::statHeadUpdateCB);
   util.m_cb.m_callbackData = stat.m_ownPtrI;
-  send.m_sysTable = c_statMetaHead;
+  send.m_sysTable = &g_statMetaHead;
   send.m_operationType = UtilPrepareReq::Update;
   statUtilPrepare(signal, stat);
 }
@@ -1947,7 +2017,7 @@ Trix::statHeadDelete(Signal* signal, Sta
 
   util.m_cb.m_callbackFunction = safe_cast(&Trix::statHeadDeleteCB);
   util.m_cb.m_callbackData = stat.m_ownPtrI;
-  send.m_sysTable = c_statMetaHead;
+  send.m_sysTable = &g_statMetaHead;
   send.m_operationType = UtilPrepareReq::Delete;
   statUtilPrepare(signal, stat);
 }
@@ -2076,7 +2146,7 @@ Trix::statUtilExecuteConf(Signal* signal
     }
     releaseSections(handle);
 
-    const Ndbcntr::SysTable& sysTable = *send.m_sysTable;
+    const SysTable& sysTable = *send.m_sysTable;
     for (Uint32 i = 0; i < sysTable.columnCount; i++)
     {
       jam();
@@ -2297,7 +2367,7 @@ Trix::statCleanPrepare(Signal* signal, S
   subRec->subscriptionKey = rand();
   subRec->prepareId = RNIL;
   subRec->indexType = 0; // not used
-  subRec->sourceTableId = c_statMetaSampleX1->indexId;
+  subRec->sourceTableId = g_statMetaSampleX1.indexId;
   subRec->targetTableId = RNIL;
   subRec->noOfIndexColumns = ao_size;
   subRec->noOfKeyColumns = 0;
@@ -2349,7 +2419,7 @@ Trix::statCleanPrepare(Signal* signal, S
   clean.m_boundSize = 3 * clean.m_boundCount;
 
   // TRIX traps the CONF
-  send.m_sysTable = c_statMetaSample;
+  send.m_sysTable = &g_statMetaSample;
   send.m_operationType = UtilPrepareReq::Delete;
   statSendPrepare(signal, stat);
 }
@@ -2418,7 +2488,7 @@ Trix::statCleanExecute(Signal* signal, S
   }
 
   // TRIX traps the CONF
-  send.m_sysTable = c_statMetaSample;
+  send.m_sysTable = &g_statMetaSample;
   send.m_operationType = UtilPrepareReq::Delete;
   send.m_prepareId = subRec->prepareId;
   subRec->expectedConf++;
@@ -2522,7 +2592,7 @@ Trix::statScanPrepare(Signal* signal, St
   ao_buf.append(ao_list, ao_size);
 
   // TRIX traps the CONF
-  send.m_sysTable = c_statMetaSample;
+  send.m_sysTable = &g_statMetaSample;
   send.m_operationType = UtilPrepareReq::Insert;
   statSendPrepare(signal, stat);
 }
@@ -2590,7 +2660,7 @@ Trix::statScanExecute(Signal* signal, St
   }
 
   // TRIX traps the CONF
-  send.m_sysTable = c_statMetaSample;
+  send.m_sysTable = &g_statMetaSample;
   send.m_operationType = UtilPrepareReq::Insert;
   send.m_prepareId = subRec->prepareId;
   subRec->expectedConf++;
@@ -2698,7 +2768,7 @@ Trix::statSendPrepare(Signal* signal, St
 {
   StatOp::Send& send = stat.m_send;
   const IndexStatImplReq* req = &stat.m_req;
-  const Ndbcntr::SysTable& sysTable = *send.m_sysTable;
+  const SysTable& sysTable = *send.m_sysTable;
   D("statSendPrepare" << V(stat));
 
   UtilPrepareReq* utilReq =
@@ -2717,7 +2787,7 @@ Trix::statSendPrepare(Signal* signal, St
 
   Uint32 i;
   for (i = 0; i < sysTable.columnCount; i++) {
-    const Ndbcntr::SysColumn& c = sysTable.columnList[i];
+    const SysColumn& c = sysTable.columnList[i];
     switch (send.m_operationType) {
     case UtilPrepareReq::Read:
     case UtilPrepareReq::Insert:
@@ -2749,7 +2819,7 @@ Trix::statSendExecute(Signal* signal, St
   D("statSendExecute" << V(stat));
   StatOp::Send& send = stat.m_send;
   StatOp::Attr& attr = stat.m_attr;
-  const Ndbcntr::SysTable& sysTable = *send.m_sysTable;
+  const SysTable& sysTable = *send.m_sysTable;
 
   UtilExecuteReq* utilReq =
     (UtilExecuteReq*)signal->getDataPtrSend();
@@ -2768,7 +2838,7 @@ Trix::statSendExecute(Signal* signal, St
   attr.m_dataSize = 0;
 
   for (Uint32 i = 0; i < sysTable.columnCount; i++) {
-    const Ndbcntr::SysColumn& c = sysTable.columnList[i];
+    const SysColumn& c = sysTable.columnList[i];
     switch (send.m_operationType) {
     case UtilPrepareReq::Read:
     case UtilPrepareReq::Insert:
@@ -2819,11 +2889,11 @@ Trix::statDataPtr(StatOp& stat, Uint32 i
   StatOp::Data& data = stat.m_data;
   StatOp::Send& send = stat.m_send;
 
-  const Ndbcntr::SysTable& sysTable = *send.m_sysTable;
+  const SysTable& sysTable = *send.m_sysTable;
   ndbrequire(i < sysTable.columnCount);
-  const Ndbcntr::SysColumn& c = sysTable.columnList[i];
+  const SysColumn& c = sysTable.columnList[i];
 
-  if (&sysTable == c_statMetaHead)
+  if (&sysTable == &g_statMetaHead)
   {
     switch (i) {
     case 0:
@@ -2869,7 +2939,7 @@ Trix::statDataPtr(StatOp& stat, Uint32 i
     return;
   }
 
-  if (&sysTable == c_statMetaSample)
+  if (&sysTable == &g_statMetaSample)
   {
     switch (i) {
     case 0:

=== modified file 'storage/ndb/src/kernel/blocks/trix/Trix.hpp'
--- a/storage/ndb/src/kernel/blocks/trix/Trix.hpp	2011-05-19 09:38:03 +0000
+++ b/storage/ndb/src/kernel/blocks/trix/Trix.hpp	2011-05-30 08:24:14 +0000
@@ -28,7 +28,6 @@
 #include <signaldata/IndexStatSignal.hpp>
 #include <signaldata/GetTabInfo.hpp>
 #include <signaldata/TuxBound.hpp>
-#include <ndbcntr/Ndbcntr.hpp>
 #define ZNOT_FOUND 626
 
 // Error codes
@@ -172,9 +171,27 @@ private:
    */
 
   bool c_statGetMetaDone;
-  const Ndbcntr::SysTable* c_statMetaHead;
-  const Ndbcntr::SysTable* c_statMetaSample;
-  const Ndbcntr::SysIndex* c_statMetaSampleX1;
+  struct SysColumn {
+    Uint32 pos;
+    const char* name;
+    bool keyFlag;
+  };
+  struct SysTable {
+    const char* name;
+    mutable Uint32 tableId;
+    const Uint32 columnCount;
+    const SysColumn* columnList;
+  };
+  struct SysIndex {
+    const char* name;
+    mutable Uint32 tableId;
+    mutable Uint32 indexId;
+  };
+  static const SysColumn g_statMetaHead_column[];
+  static const SysColumn g_statMetaSample_column[];
+  static const SysTable g_statMetaHead;
+  static const SysTable g_statMetaSample;
+  static const SysIndex g_statMetaSampleX1;
 
   struct StatOp {
     struct Meta {
@@ -233,7 +250,7 @@ private:
     struct Drop {
     };
     struct Send {
-      const Ndbcntr::SysTable* m_sysTable;
+      const SysTable* m_sysTable;
       Uint32 m_operationType;     // UtilPrepareReq::OperationTypeValue
       Uint32 m_prepareId;
       Send() {}


Attachment: [text/bzr-bundle] bzr/pekka.nousiainen@oracle.com-20110530082414-oaamubliy6n3pbla.bundle
Thread
bzr commit into mysql-5.1-telco-7.0-wl4124-new0 branch(pekka.nousiainen:4387) WL#4124Pekka Nousiainen31 May