4371 Pekka Nousiainen 2011-05-17
wl#4163 i05_fix.diff
remove debug buffer from stack (MT build 8k stack)
modified:
storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp
4370 Pekka Nousiainen 2011-05-09
wl#4163 i04_fix.diff
size_t warning on windows + NdbPack-t link libs
modified:
storage/ndb/src/common/util/CMakeLists.txt
storage/ndb/src/common/util/NdbPack.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2011-05-04 12:29:26 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2011-05-17 12:19:20 +0000
@@ -131,6 +131,10 @@ private:
STATIC_CONST( ScanBoundSegmentSize = 7 );
STATIC_CONST( MaxAccLockOps = MAX_PARALLEL_OP_PER_SCAN );
STATIC_CONST( MaxTreeDepth = 32 ); // strict
+#ifdef VM_TRACE
+ // for TuxCtx::c_debugBuffer
+ STATIC_CONST( DebugBufferBytes = (MaxAttrDataSize << 2) );
+#endif
BLOCK_DEFINES(Dbtux);
// forward declarations
@@ -633,8 +637,8 @@ private:
/*
* DbtuxCmp.cpp
*/
- int cmpSearchKey(const KeyDataC& searchKey, const KeyDataC& entryKey, Uint32 cnt);
- int cmpSearchBound(const KeyBoundC& searchBound, const KeyDataC& entryKey, Uint32 cnt);
+ int cmpSearchKey(TuxCtx&, const KeyDataC& searchKey, const KeyDataC& entryKey, Uint32 cnt);
+ int cmpSearchBound(TuxCtx&, const KeyBoundC& searchBound, const KeyDataC& entryKey, Uint32 cnt);
/*
* DbtuxStat.cpp
@@ -710,6 +714,10 @@ private:
// buffer for xfrm-ed PK and for temporary use
Uint32* c_dataBuffer;
+
+#ifdef VM_TRACE
+ char* c_debugBuffer;
+#endif
};
struct TuxCtx c_ctx; // Global Tux context, for everything build MT-index build
@@ -1239,17 +1247,16 @@ Dbtux::max(unsigned x, unsigned y)
// DbtuxCmp.cpp
inline int
-Dbtux::cmpSearchKey(const KeyDataC& searchKey, const KeyDataC& entryKey, Uint32 cnt)
+Dbtux::cmpSearchKey(TuxCtx& ctx, const KeyDataC& searchKey, const KeyDataC& entryKey, Uint32 cnt)
{
// compare cnt attributes from each
Uint32 num_eq;
int ret = searchKey.cmp(entryKey, cnt, num_eq);
#ifdef VM_TRACE
if (debugFlags & DebugMaint) {
- char tmp[MaxAttrDataSize << 2];
debugOut << "cmpSearchKey: ret:" << ret;
- debugOut << " search:" << searchKey.print(tmp, sizeof(tmp));
- debugOut << " entry:" << entryKey.print(tmp, sizeof(tmp));
+ debugOut << " search:" << searchKey.print(ctx.c_debugBuffer, DebugBufferBytes);
+ debugOut << " entry:" << entryKey.print(ctx.c_debugBuffer, DebugBufferBytes);
debugOut << endl;
}
#endif
@@ -1257,17 +1264,16 @@ Dbtux::cmpSearchKey(const KeyDataC& sear
}
inline int
-Dbtux::cmpSearchBound(const KeyBoundC& searchBound, const KeyDataC& entryKey, Uint32 cnt)
+Dbtux::cmpSearchBound(TuxCtx& ctx, const KeyBoundC& searchBound, const KeyDataC& entryKey, Uint32 cnt)
{
// compare cnt attributes from each
Uint32 num_eq;
int ret = searchBound.cmp(entryKey, cnt, num_eq);
#ifdef VM_TRACE
if (debugFlags & DebugScan) {
- char tmp[MaxAttrDataSize << 2];
debugOut << "cmpSearchBound: res:" << ret;
- debugOut << " search:" << searchBound.print(tmp, sizeof(tmp));
- debugOut << " entry:" << entryKey.print(tmp, sizeof(tmp));
+ debugOut << " search:" << searchBound.print(ctx.c_debugBuffer, DebugBufferBytes);
+ debugOut << " entry:" << entryKey.print(ctx.c_debugBuffer, DebugBufferBytes);
debugOut << endl;
}
#endif
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp 2011-05-04 12:29:26 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp 2011-05-17 12:19:20 +0000
@@ -54,6 +54,10 @@ Dbtux::mt_buildIndexFragment_wrapper(voi
ptr += MaxAttrDataSize;
tux_ctx->c_dataBuffer = ptr;
ptr += MaxAttrDataSize;
+#ifdef VM_TRACE
+ tux_ctx->c_debugBuffer = (char*)ptr;
+ ptr += (DebugBufferBytes + 3) / 4;
+#endif
if (!(UintPtr(ptr) - UintPtr(req->mem_buffer) <= req->buffer_size))
abort();
}
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp 2011-05-04 12:29:26 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp 2011-05-17 12:19:20 +0000
@@ -292,7 +292,7 @@ Dbtux::printNode(TuxCtx & ctx,
Uint32 data2[MaxPrefSize];
keyData2.set_buf(data2, MaxPrefSize << 2);
readKeyAttrs(ctx, frag, node.getEnt(0), keyData2, index.m_prefAttrs);
- if (cmpSearchKey(keyData1, keyData2, index.m_prefAttrs) != 0) {
+ if (cmpSearchKey(ctx, keyData1, keyData2, index.m_prefAttrs) != 0) {
par.m_ok = false;
out << par.m_path << sep;
out << "inline prefix mismatch" << endl;
@@ -308,7 +308,7 @@ Dbtux::printNode(TuxCtx & ctx,
entryKey2.set_buf(ctx.c_entryKey, MaxAttrDataSize << 2);
readKeyAttrs(ctx, frag, ent1, entryKey1, index.m_numAttrs);
readKeyAttrs(ctx, frag, ent2, entryKey2, index.m_numAttrs);
- int ret = cmpSearchKey(entryKey1, entryKey2, index.m_numAttrs);
+ int ret = cmpSearchKey(ctx, entryKey1, entryKey2, index.m_numAttrs);
if (ret == 0)
ret = ent1.cmp(ent2);
if (! (ret < 0)) {
@@ -330,7 +330,7 @@ Dbtux::printNode(TuxCtx & ctx,
entryKey2.set_buf(ctx.c_entryKey, MaxAttrDataSize << 2);
readKeyAttrs(ctx, frag, ent1, entryKey1, index.m_numAttrs);
readKeyAttrs(ctx, frag, ent2, entryKey2, index.m_numAttrs);
- int ret = cmpSearchKey(entryKey1, entryKey2, index.m_numAttrs);
+ int ret = cmpSearchKey(ctx, entryKey1, entryKey2, index.m_numAttrs);
if (ret == 0)
ret = ent1.cmp(ent2);
if (i == 0 && ! (ret < 0) ||
@@ -447,9 +447,8 @@ operator<<(NdbOut& out, const Dbtux::Sca
Dbtux::KeyDataC keyBoundData(index.m_keySpec, true);
Dbtux::KeyBoundC keyBound(keyBoundData);
tux->unpackBound(tux->c_ctx, scanBound, keyBound);
- char tmp[Dbtux::MaxAttrDataSize << 2];
out << " [scanBound " << dec << i;
- out << " " << keyBound.print(tmp, sizeof(tmp));
+ out << " " << keyBound.print(tux->c_ctx.c_debugBuffer, Dbtux::DebugBufferBytes);
out << "]";
}
return out;
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp 2011-05-04 12:29:26 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp 2011-05-17 12:19:20 +0000
@@ -234,6 +234,10 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signa
c_ctx.c_dataBuffer = (Uint32*)allocRecord("c_dataBuffer", sizeof(Uint64), (MaxXfrmDataSize + 1) >> 1);
+#ifdef VM_TRACE
+ c_ctx.c_debugBuffer = (char*)allocRecord("c_debugBuffer", sizeof(char), DebugBufferBytes);
+#endif
+
// ack
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
conf->senderRef = reference();
@@ -278,10 +282,9 @@ Dbtux::readKeyAttrs(TuxCtx& ctx, const F
#ifdef VM_TRACE
if (debugFlags & (DebugMaint | DebugScan)) {
- char tmp[MaxAttrDataSize << 2];
debugOut << "readKeyAttrs: ";
debugOut << " ent:" << ent << " count:" << count;
- debugOut << " data:" << keyData.print(tmp, sizeof(tmp));
+ debugOut << " data:" << keyData.print(ctx.c_debugBuffer, DebugBufferBytes);
debugOut << endl;
}
#endif
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp 2011-05-04 12:14:36 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp 2011-05-17 12:19:20 +0000
@@ -163,9 +163,9 @@ Dbtux::setNodePref(TuxCtx & ctx, NodeHan
}
#ifdef VM_TRACE
if (debugFlags & DebugMaint) {
- char tmp[MaxAttrDataSize << 2];
debugOut << "setNodePref: " << node;
- debugOut << " " << prefKey.print(tmp, sizeof(tmp)) << endl;
+ debugOut << " " << prefKey.print(ctx.c_debugBuffer, DebugBufferBytes);
+ debugOut << endl;
}
#endif
}
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp 2011-05-04 12:29:26 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp 2011-05-17 12:19:20 +0000
@@ -1022,7 +1022,7 @@ Dbtux::scanCheck(ScanOpPtr scanPtr, Tree
readKeyAttrs(c_ctx, frag, ent, entryKey, index.m_numAttrs);
// compare bound to key
const Uint32 boundCount = searchBound.get_data().get_cnt();
- ret = cmpSearchBound(searchBound, entryKey, boundCount);
+ ret = cmpSearchBound(c_ctx, searchBound, entryKey, boundCount);
ndbrequire(ret != 0);
ret = (-1) * ret; // reverse for key vs bound
ret = jdir * ret; // reverse for descending scan
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp 2011-05-04 12:25:51 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp 2011-05-17 12:19:20 +0000
@@ -49,13 +49,13 @@ Dbtux::findNodeToUpdate(TuxCtx& ctx, Fra
int ret = 0;
if (prefAttrs > 0) {
thrjam(ctx.jamBuffer);
- ret = cmpSearchKey(searchKey, prefKey, prefAttrs);
+ ret = cmpSearchKey(ctx, searchKey, prefKey, prefAttrs);
}
if (ret == 0 && prefAttrs < numAttrs) {
thrjam(ctx.jamBuffer);
// read and compare all attributes
readKeyAttrs(ctx, frag, currNode.getEnt(0), entryKey, numAttrs);
- ret = cmpSearchKey(searchKey, entryKey, numAttrs);
+ ret = cmpSearchKey(ctx, searchKey, entryKey, numAttrs);
}
if (ret == 0) {
thrjam(ctx.jamBuffer);
@@ -115,7 +115,7 @@ Dbtux::findPosToAdd(TuxCtx& ctx, Frag& f
int j = (hi + lo) / 2;
// read and compare all attributes
readKeyAttrs(ctx, frag, currNode.getEnt(j), entryKey, index.m_numAttrs);
- int ret = cmpSearchKey(searchKey, entryKey, index.m_numAttrs);
+ int ret = cmpSearchKey(ctx, searchKey, entryKey, index.m_numAttrs);
if (ret == 0) {
thrjam(ctx.jamBuffer);
// keys are equal, compare entry values
@@ -233,13 +233,13 @@ Dbtux::findNodeToScan(Frag& frag, unsign
if (prefAttrs > 0) {
jam();
// compare node prefix - result 0 implies bound is longer
- ret = cmpSearchBound(searchBound, prefKey, prefAttrs);
+ ret = cmpSearchBound(c_ctx, searchBound, prefKey, prefAttrs);
}
if (ret == 0) {
jam();
// read and compare all attributes
readKeyAttrs(c_ctx, frag, currNode.getEnt(0), entryKey, numAttrs);
- ret = cmpSearchBound(searchBound, entryKey, numAttrs);
+ ret = cmpSearchBound(c_ctx, searchBound, entryKey, numAttrs);
ndbrequire(ret != 0);
}
} else {
@@ -304,7 +304,7 @@ Dbtux::findPosToScan(Frag& frag, unsigne
if (numAttrs != 0) {
// read and compare all attributes
readKeyAttrs(c_ctx, frag, currNode.getEnt(j), entryKey, numAttrs);
- ret = cmpSearchBound(searchBound, entryKey, numAttrs);
+ ret = cmpSearchBound(c_ctx, searchBound, entryKey, numAttrs);
ndbrequire(ret != 0);
}
if (ret < 0) {
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0-wl4163 branch (pekka:4370 to 4371) WL#4163 | Pekka Nousiainen | 19 May |