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, 2007-01-09 06:23:40+01:00, pekka@stripped +2 -0
ndb - wl#3600 op sections
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2007-01-09 06:22:58+01:00, pekka@stripped +83 -0
wl#3600 signal sections are saved under SchemaOp in DICT owned segments
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp@stripped, 2007-01-09 06:22:58+01:00, pekka@stripped +22 -0
wl#3600 signal sections are saved under SchemaOp in DICT owned segments
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: pekka
# Host: clam.(none)
# Root: /export/space/pekka/ndb/version/my52-wl3600-m
--- 1.124/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2007-01-04 11:16:37 +01:00
+++ 1.125/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2007-01-09 06:22:58 +01:00
@@ -2080,6 +2080,7 @@
g_key_descriptor_pool.setSize(tablerecSize);
c_triggerRecordPool.setSize(c_maxNoOfTriggers);
+ c_opSectionBufferPool.setSize(2048); // unit OpSectionSegmentSize
c_schemaOpPool.setSize(256);
c_schemaOpHash.setSize(256);
c_schemaTransPool.setSize(2);
@@ -16781,6 +16782,61 @@
return g_opInfoList[i];
}
+// OpData
+
+// OpSection
+
+bool
+Dbdict::copyToOpSection(OpSection& opSection, SegmentedSectionPtr ss_ptr)
+{
+ OpSectionBuffer buffer(c_opSectionBufferPool, opSection.m_head);
+ SimplePropertiesSectionReader r(ss_ptr, getSectionSegmentPool());
+
+ // undo any ctor-invoked first()
+ r.reset();
+
+ const Uint32 size = ss_ptr.sz;
+ Uint32 n = 0;
+ while (n < size) {
+ Uint32 buf[OpSectionSegmentSize];
+ bool ok;
+ Uint32 m = OpSectionSegmentSize;
+ if (m > size - n)
+ m = size - n;
+#if wl3600_todo // plain SectionReader crashes on multiple words
+ m = 1;
+#endif
+ ok = r.getWords(buf, m);
+ ndbrequire(ok);
+ ok = buffer.append(buf, m);
+ if (!ok)
+ return false;
+ n += m;
+ }
+ ndbrequire(n == size && buffer.getSize() == size);
+ return true;
+}
+
+bool
+Dbdict::copyFromOpSection(OpSection opSection, Uint32* dst, Uint32 dstSize)
+{
+ OpSectionBuffer buffer(c_opSectionBufferPool, opSection.m_head);
+ const Uint32 size = buffer.getSize();
+ if (size > dstSize)
+ return false;
+
+ OpSectionBuffer::ConstDataBufferIterator iter;
+ Uint32 n = 0;
+ buffer.first(iter);
+ while (!iter.isNull()) {
+ dst[n] = *iter.data;
+ n++;
+ buffer.next(iter);
+ }
+ ndbrequire(n == size);
+ return true;
+}
+
// SchemaOp
const Dbdict::OpInfo&
@@ -16844,6 +16900,33 @@
c_schemaOpHash.release(op_ptr);
op_ptr.setNull();
}
+
+// save signal sections
+
+bool
+Dbdict::saveOpSection(SchemaOpPtr op_ptr,
+ Signal* signal, Uint32 ss_no)
+{
+ SegmentedSectionPtr ss_ptr;
+ bool ok = signal->getSection(ss_ptr, ss_no);
+ ndbrequire(ok);
+ return saveOpSection(op_ptr, ss_ptr, ss_no);
+}
+
+bool
+Dbdict::saveOpSection(SchemaOpPtr op_ptr,
+ SegmentedSectionPtr ss_ptr, Uint32 ss_no)
+{
+ ndbrequire(ss_no <= 2 && op_ptr.p->m_sections == ss_no);
+ OpSection& opSection = op_ptr.p->m_section[ss_no];
+ op_ptr.p->m_sections++;
+
+ bool ok = copyToOpSection(opSection, ss_ptr);
+ ndbrequire(ok);
+ return true;
+}
+
+// add schema op to trans during parse phase
void
Dbdict::addSchemaOp(SchemaTransPtr trans_ptr, SchemaOpPtr& op_ptr)
--- 1.54/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp 2007-01-04 11:16:37 +01:00
+++ 1.55/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp 2007-01-09 06:22:58 +01:00
@@ -1258,6 +1258,19 @@
};
typedef Ptr<OpData> OpDataPtr;
+ // OpSection
+
+ enum { OpSectionSegmentSize = 127 };
+ typedef LocalDataBuffer<OpSectionSegmentSize> OpSectionBuffer;
+ OpSectionBuffer::DataBufferPool c_opSectionBufferPool;
+
+ struct OpSection {
+ OpSectionBuffer::Head m_head;
+ };
+
+ bool copyToOpSection(OpSection&, SegmentedSectionPtr);
+ bool copyFromOpSection(OpSection, Uint32* dst, Uint32 size);
+
// SchemaOp
struct SchemaOp {
@@ -1289,11 +1302,16 @@
// type specific data record
OpDataPtr m_data_ptr;
+ // saved signal sections or other variable data
+ OpSection m_section[3];
+ Uint32 m_sections;
+
SchemaOp() {
m_clientRef = 0;
m_clientData = 0;
m_trans_ptr.setNull();
m_data_ptr.setNull();
+ m_sections = 0;
}
SchemaOp(Uint32 the_op_key) {
@@ -1421,6 +1439,10 @@
}
void releaseSchemaOp(SchemaOpPtr& op_ptr);
+
+ // copy signal sections to schema op sections
+ bool saveOpSection(SchemaOpPtr, Signal*, Uint32 ss_no);
+ bool saveOpSection(SchemaOpPtr, SegmentedSectionPtr ss_ptr, Uint32 ss_no);
// add operation to transaction OpList
void addSchemaOp(SchemaTransPtr, SchemaOpPtr&);
| Thread |
|---|
| • bk commit into 5.1 tree (pekka:1.2382) | pekka | 9 Jan |