summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorunknown <mskold@linux.site>2006-07-04 09:17:32 +0200
committerunknown <mskold@linux.site>2006-07-04 09:17:32 +0200
commit2773b73ce2d5d0c008a71caeedb6822623fd0fa7 (patch)
tree0bdc5849bb77f9dd9605328e7cf0da54df0ed20e /storage
parent2ef57b836248f945657c7bd0fe02fa7fe3660b54 (diff)
parentf9bc24ef76f0fd54b6dc84291d5effe29b262c97 (diff)
downloadmariadb-git-2773b73ce2d5d0c008a71caeedb6822623fd0fa7.tar.gz
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1
into mysql.com:/home/marty/MySQL/mysql-5.1-extra sql/ha_ndbcluster.cc: Auto merged
Diffstat (limited to 'storage')
-rw-r--r--storage/ndb/include/kernel/AttributeHeader.hpp3
-rw-r--r--storage/ndb/include/ndbapi/NdbDictionary.hpp3
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp1
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp1
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp21
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp1
-rw-r--r--storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp24
-rw-r--r--storage/ndb/tools/desc.cpp3
8 files changed, 40 insertions, 17 deletions
diff --git a/storage/ndb/include/kernel/AttributeHeader.hpp b/storage/ndb/include/kernel/AttributeHeader.hpp
index b17bb456bf0..b78b5912bec 100644
--- a/storage/ndb/include/kernel/AttributeHeader.hpp
+++ b/storage/ndb/include/kernel/AttributeHeader.hpp
@@ -39,12 +39,13 @@ public:
STATIC_CONST( RANGE_NO = 0xFFFB ); // Read range no (when batched ranges)
STATIC_CONST( ROW_SIZE = 0xFFFA );
- STATIC_CONST( FRAGMENT_MEMORY= 0xFFF9 );
+ STATIC_CONST( FRAGMENT_FIXED_MEMORY= 0xFFF9 );
STATIC_CONST( RECORDS_IN_RANGE = 0xFFF8 );
STATIC_CONST( DISK_REF = 0xFFF7 );
STATIC_CONST( ROWID = 0xFFF6 );
STATIC_CONST( ROW_GCI = 0xFFF5 );
+ STATIC_CONST( FRAGMENT_VARSIZED_MEMORY = 0xFFF4 );
// NOTE: in 5.1 ctors and init take size in bytes
diff --git a/storage/ndb/include/ndbapi/NdbDictionary.hpp b/storage/ndb/include/ndbapi/NdbDictionary.hpp
index ea4a2a9ca29..35b0d927bda 100644
--- a/storage/ndb/include/ndbapi/NdbDictionary.hpp
+++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp
@@ -525,7 +525,8 @@ public:
const char* getDefaultValue() const;
static const Column * FRAGMENT;
- static const Column * FRAGMENT_MEMORY;
+ static const Column * FRAGMENT_FIXED_MEMORY;
+ static const Column * FRAGMENT_VARSIZED_MEMORY;
static const Column * ROW_COUNT;
static const Column * COMMIT_COUNT;
static const Column * ROW_SIZE;
diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
index 9bc916c8c22..3cf62fe08ec 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
@@ -604,6 +604,7 @@ struct Fragrecord {
Uint32 currentPageRange;
Uint32 rootPageRange;
Uint32 noOfPages;
+ Uint32 noOfVarPages;
Uint32 noOfPagesToGrow;
DLList<Page>::Head emptyPrimPage; // allocated pages (not init)
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp
index 90fdd8c69d7..82bac432545 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp
@@ -351,6 +351,7 @@ void Dbtup::initFragRange(Fragrecord* const regFragPtr)
regFragPtr->rootPageRange = RNIL;
regFragPtr->currentPageRange = RNIL;
regFragPtr->noOfPages = 0;
+ regFragPtr->noOfVarPages = 0;
regFragPtr->noOfPagesToGrow = 2;
regFragPtr->nextStartRange = 0;
}//initFragRange()
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
index 940ccf54ba7..677eff53559 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
@@ -1135,13 +1135,20 @@ Dbtup::read_pseudo(Uint32 attrId,
case AttributeHeader::FRAGMENT:
* outBuffer = fragptr.p->fragmentId;
return 1;
- case AttributeHeader::FRAGMENT_MEMORY:
- {
- Uint64 tmp= fragptr.p->noOfPages;
- tmp*= 32768;
- memcpy(outBuffer,&tmp,8);
- }
- return 2;
+ case AttributeHeader::FRAGMENT_FIXED_MEMORY:
+ {
+ Uint64 tmp= fragptr.p->noOfPages;
+ tmp*= 32768;
+ memcpy(outBuffer,&tmp,8);
+ }
+ return 2;
+ case AttributeHeader::FRAGMENT_VARSIZED_MEMORY:
+ {
+ Uint64 tmp= fragptr.p->noOfVarPages;
+ tmp*= 32768;
+ memcpy(outBuffer,&tmp,8);
+ }
+ return 2;
case AttributeHeader::ROW_SIZE:
* outBuffer = tabptr.p->m_offsets[MM].m_fix_header_size << 2;
return 1;
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp
index 52ab66b5c0e..5f6dd68956a 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp
@@ -302,6 +302,7 @@ Dbtup::get_empty_var_page(Fragrecord* fragPtr)
Uint32 cnt;
allocConsPages(10, cnt, ptr.i);
+ fragPtr->noOfVarPages+= cnt;
if (unlikely(cnt == 0))
{
return RNIL;
diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 1e33a843a42..b9c03f0b209 100644
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -328,9 +328,14 @@ NdbColumnImpl::create_pseudo(const char * name){
col->m_impl.m_attrId = AttributeHeader::FRAGMENT;
col->m_impl.m_attrSize = 4;
col->m_impl.m_arraySize = 1;
- } else if(!strcmp(name, "NDB$FRAGMENT_MEMORY")){
+ } else if(!strcmp(name, "NDB$FRAGMENT_FIXED_MEMORY")){
col->setType(NdbDictionary::Column::Bigunsigned);
- col->m_impl.m_attrId = AttributeHeader::FRAGMENT_MEMORY;
+ col->m_impl.m_attrId = AttributeHeader::FRAGMENT_FIXED_MEMORY;
+ col->m_impl.m_attrSize = 8;
+ col->m_impl.m_arraySize = 1;
+ } else if(!strcmp(name, "NDB$FRAGMENT_VARSIZED_MEMORY")){
+ col->setType(NdbDictionary::Column::Bigunsigned);
+ col->m_impl.m_attrId = AttributeHeader::FRAGMENT_VARSIZED_MEMORY;
col->m_impl.m_attrSize = 8;
col->m_impl.m_arraySize = 1;
} else if(!strcmp(name, "NDB$ROW_COUNT")){
@@ -1316,7 +1321,8 @@ NdbDictionaryImpl::~NdbDictionaryImpl()
m_globalHash->lock();
if(--f_dictionary_count == 0){
delete NdbDictionary::Column::FRAGMENT;
- delete NdbDictionary::Column::FRAGMENT_MEMORY;
+ delete NdbDictionary::Column::FRAGMENT_FIXED_MEMORY;
+ delete NdbDictionary::Column::FRAGMENT_VARSIZED_MEMORY;
delete NdbDictionary::Column::ROW_COUNT;
delete NdbDictionary::Column::COMMIT_COUNT;
delete NdbDictionary::Column::ROW_SIZE;
@@ -1326,7 +1332,8 @@ NdbDictionaryImpl::~NdbDictionaryImpl()
delete NdbDictionary::Column::ROWID;
delete NdbDictionary::Column::ROW_GCI;
NdbDictionary::Column::FRAGMENT= 0;
- NdbDictionary::Column::FRAGMENT_MEMORY= 0;
+ NdbDictionary::Column::FRAGMENT_FIXED_MEMORY= 0;
+ NdbDictionary::Column::FRAGMENT_VARSIZED_MEMORY= 0;
NdbDictionary::Column::ROW_COUNT= 0;
NdbDictionary::Column::COMMIT_COUNT= 0;
NdbDictionary::Column::ROW_SIZE= 0;
@@ -1483,8 +1490,10 @@ NdbDictionaryImpl::setTransporter(class Ndb* ndb,
if(f_dictionary_count++ == 0){
NdbDictionary::Column::FRAGMENT=
NdbColumnImpl::create_pseudo("NDB$FRAGMENT");
- NdbDictionary::Column::FRAGMENT_MEMORY=
- NdbColumnImpl::create_pseudo("NDB$FRAGMENT_MEMORY");
+ NdbDictionary::Column::FRAGMENT_FIXED_MEMORY=
+ NdbColumnImpl::create_pseudo("NDB$FRAGMENT_FIXED_MEMORY");
+ NdbDictionary::Column::FRAGMENT_VARSIZED_MEMORY=
+ NdbColumnImpl::create_pseudo("NDB$FRAGMENT_VARSIZED_MEMORY");
NdbDictionary::Column::ROW_COUNT=
NdbColumnImpl::create_pseudo("NDB$ROW_COUNT");
NdbDictionary::Column::COMMIT_COUNT=
@@ -5041,7 +5050,8 @@ template class Vector<NdbTableImpl*>;
template class Vector<NdbColumnImpl*>;
const NdbDictionary::Column * NdbDictionary::Column::FRAGMENT = 0;
-const NdbDictionary::Column * NdbDictionary::Column::FRAGMENT_MEMORY = 0;
+const NdbDictionary::Column * NdbDictionary::Column::FRAGMENT_FIXED_MEMORY = 0;
+const NdbDictionary::Column * NdbDictionary::Column::FRAGMENT_VARSIZED_MEMORY = 0;
const NdbDictionary::Column * NdbDictionary::Column::ROW_COUNT = 0;
const NdbDictionary::Column * NdbDictionary::Column::COMMIT_COUNT = 0;
const NdbDictionary::Column * NdbDictionary::Column::ROW_SIZE = 0;
diff --git a/storage/ndb/tools/desc.cpp b/storage/ndb/tools/desc.cpp
index 7c5ce68c950..49f188d12c0 100644
--- a/storage/ndb/tools/desc.cpp
+++ b/storage/ndb/tools/desc.cpp
@@ -293,7 +293,8 @@ void print_part_info(Ndb* pNdb, NDBT_Table* pTab)
{ "Partition", 0, NdbDictionary::Column::FRAGMENT },
{ "Row count", 0, NdbDictionary::Column::ROW_COUNT },
{ "Commit count", 0, NdbDictionary::Column::COMMIT_COUNT },
- { "Frag memory", 0, NdbDictionary::Column::FRAGMENT_MEMORY },
+ { "Frag fixed memory", 0, NdbDictionary::Column::FRAGMENT_FIXED_MEMORY },
+ { "Frag varsized memory", 0, NdbDictionary::Column::FRAGMENT_VARSIZED_MEMORY },
{ 0, 0, 0 }
};