List:Commits« Previous MessageNext Message »
From:jonas oreland Date:February 16 2011 2:53pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (jonas:4201)
View as plain text  
#At file:///home/jonas/src/telco-7.0/ based on revid:magnus.blaudd@stripped

 4201 jonas oreland	2011-02-16
      ndb - add storage type on table, so that it doesnt need to be saved in frm

    modified:
      storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
      storage/ndb/include/ndb_constants.h
      storage/ndb/include/ndbapi/NdbDictionary.hpp
      storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
      storage/ndb/src/ndbapi/NdbDictionary.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
=== modified file 'storage/ndb/include/kernel/signaldata/DictTabInfo.hpp'
--- a/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp	2011-02-16 14:53:53 +0000
@@ -148,6 +148,8 @@ public:
     HashMapObjectId    = 153,
     HashMapVersion     = 154,
 
+    TableStorageType   = 155,
+
     TableEnd           = 999,
     
     AttributeName          = 1000, // String, Mandatory
@@ -376,7 +378,9 @@ public:
 
     Uint32 HashMapObjectId;
     Uint32 HashMapVersion;
-    
+
+    Uint32 TableStorageType;
+
     Table() {}
     void init();
   };

=== modified file 'storage/ndb/include/ndb_constants.h'
--- a/storage/ndb/include/ndb_constants.h	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/ndb_constants.h	2011-02-16 14:53:53 +0000
@@ -87,6 +87,7 @@
 
 #define NDB_STORAGETYPE_MEMORY          0
 #define NDB_STORAGETYPE_DISK            1
+#define NDB_STORAGETYPE_DEFAULT         2 /* not set */
 
 /*
  * Table temporary status.

=== modified file 'storage/ndb/include/ndbapi/NdbDictionary.hpp'
--- a/storage/ndb/include/ndbapi/NdbDictionary.hpp	2011-02-09 14:18:53 +0000
+++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp	2011-02-16 14:53:53 +0000
@@ -287,7 +287,8 @@ public:
      */
     enum StorageType {
       StorageTypeMemory = NDB_STORAGETYPE_MEMORY,
-      StorageTypeDisk = NDB_STORAGETYPE_DISK
+      StorageTypeDisk = NDB_STORAGETYPE_DISK,
+      StorageTypeDefault = NDB_STORAGETYPE_DEFAULT
     };
 
     /** 
@@ -1054,6 +1055,12 @@ public:
      *   this as way way too much stuff is pushed into NdbDictInterface
      */
     void assignObjId(const ObjectId &);
+
+    /**
+     * set/get table-storage-method
+     */
+    void setStorageType(Column::StorageType);
+    Column::StorageType getStorageType() const;
 #endif
 
     // these 2 are not de-doxygenated

=== modified file 'storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp	2011-02-16 14:53:53 +0000
@@ -72,6 +72,7 @@ DictTabInfo::TableMapping[] = {
   DTIMAP(Table, SingleUserMode, SingleUserMode),
   DTIMAP(Table, HashMapObjectId, HashMapObjectId),
   DTIMAP(Table, HashMapVersion, HashMapVersion),
+  DTIMAP(Table, TableStorageType, TableStorageType),
   DTIBREAK(AttributeName)
 };
 
@@ -181,6 +182,8 @@ DictTabInfo::Table::init(){
 
   HashMapObjectId = RNIL;
   HashMapVersion = RNIL;
+
+  TableStorageType = NDB_STORAGETYPE_DEFAULT;
 }
 
 void

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2011-02-15 10:52:32 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2011-02-16 14:53:53 +0000
@@ -744,6 +744,7 @@ Dbdict::packTableIntoPages(SimplePropert
   w.add(DictTabInfo::MinRowsHigh, tablePtr.p->minRowsHigh);
   w.add(DictTabInfo::SingleUserMode, tablePtr.p->singleUserMode);
   w.add(DictTabInfo::HashMapObjectId, tablePtr.p->hashMapObjectId);
+  w.add(DictTabInfo::TableStorageType, tablePtr.p->storageType);
 
   if (tablePtr.p->hashMapObjectId != RNIL)
   {
@@ -2452,6 +2453,7 @@ void Dbdict::initialiseTableRecord(Table
   tablePtr.p->triggerId = RNIL;
   tablePtr.p->buildTriggerId = RNIL;
   tablePtr.p->m_read_locked= 0;
+  tablePtr.p->storageType = NDB_STORAGETYPE_DEFAULT;
 }//Dbdict::initialiseTableRecord()
 
 void Dbdict::initTriggerRecords()
@@ -4941,6 +4943,7 @@ void Dbdict::handleTabInfoInit(Signal * 
   tablePtr.p->singleUserMode = c_tableDesc.SingleUserMode;
   tablePtr.p->hashMapObjectId = c_tableDesc.HashMapObjectId;
   tablePtr.p->hashMapVersion = c_tableDesc.HashMapVersion;
+  tablePtr.p->storageType = c_tableDesc.TableStorageType;
 
   tabRequire(tablePtr.p->noOfAttributes <= MAX_ATTRIBUTES_IN_TABLE,
              CreateTableRef::NoMoreAttributeRecords); // bad error code!

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2011-02-16 14:53:53 +0000
@@ -330,6 +330,11 @@ public:
      */
     Uint8 minLoadFactor;
 
+    /**
+     * Table default storage method
+     */
+    Uint8 storageType; // NDB_STORAGETYPE_
+
     /* Convenience routines */
     bool isTable() const;
     bool isIndex() const;

=== modified file 'storage/ndb/src/ndbapi/NdbDictionary.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionary.cpp	2011-02-09 14:18:53 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionary.cpp	2011-02-16 14:53:53 +0000
@@ -1003,6 +1003,18 @@ NdbDictionary::Table::assignObjId(const 
   m_impl.m_version = objId.m_version;
 }
 
+void
+NdbDictionary::Table::setStorageType(NdbDictionary::Column::StorageType type)
+{
+  m_impl.m_storageType = type;
+}
+
+NdbDictionary::Column::StorageType
+NdbDictionary::Table::getStorageType() const
+{
+  return (NdbDictionary::Column::StorageType)m_impl.m_storageType;
+}
+
 /*****************************************************************
  * Index facade
  */

=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2011-02-04 17:52:38 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2011-02-16 14:53:53 +0000
@@ -2681,6 +2681,7 @@ NdbDictInterface::parseTableInfo(NdbTabl
   impl->m_minLoadFactor = tableDesc->MinLoadFactor;
   impl->m_maxLoadFactor = tableDesc->MaxLoadFactor;
   impl->m_single_user_mode = tableDesc->SingleUserMode;
+  impl->m_storageType = tableDesc->TableStorageType;
 
   impl->m_indexType = (NdbDictionary::Object::Type)
     getApiConstant(tableDesc->TableType,
@@ -3393,6 +3394,7 @@ NdbDictInterface::serializeTableDesc(Ndb
 
   tmpTab->HashMapObjectId = impl.m_hash_map_id;
   tmpTab->HashMapVersion = impl.m_hash_map_version;
+  tmpTab->TableStorageType = impl.m_storageType;
 
   const char *tablespace_name= impl.m_tablespace_name.c_str();
 loop:

=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp	2011-02-03 14:20:36 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp	2011-02-16 14:53:53 +0000
@@ -233,6 +233,7 @@ public:
   Uint16 m_keyLenInWords;
   Uint16 m_fragmentCount;
   Uint8 m_single_user_mode;
+  Uint8 m_storageType;  // NDB_STORAGETYPE_MEMORY or _DISK or DEFAULT
 
   NdbIndexImpl * m_index;
   NdbColumnImpl * getColumn(unsigned attrId);


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20110216145353-w1018jc9uhrmy92f.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jonas:4201) jonas oreland16 Feb