Commit d44070ef authored by pekka@mysql.com's avatar pekka@mysql.com

NDB dbtux - remove obsolete code

parent 69f0df8a
...@@ -250,8 +250,8 @@ private: ...@@ -250,8 +250,8 @@ private:
static const unsigned NodeHeadSize = sizeof(TreeNode) >> 2; static const unsigned NodeHeadSize = sizeof(TreeNode) >> 2;
/* /*
* Tree nodes are not always accessed fully, for cache reasons. There * Tree node "access size" was for an early version with signal
* are 3 access sizes. * interface to TUP. It is now used only to compute sizes.
*/ */
enum AccSize { enum AccSize {
AccNone = 0, AccNone = 0,
...@@ -522,7 +522,6 @@ private: ...@@ -522,7 +522,6 @@ private:
Frag& m_frag; // fragment using the node Frag& m_frag; // fragment using the node
TupLoc m_loc; // physical node address TupLoc m_loc; // physical node address
TreeNode* m_node; // pointer to node storage TreeNode* m_node; // pointer to node storage
AccSize m_acc; // accessed size
NodeHandle(Frag& frag); NodeHandle(Frag& frag);
NodeHandle(const NodeHandle& node); NodeHandle(const NodeHandle& node);
NodeHandle& operator=(const NodeHandle& node); NodeHandle& operator=(const NodeHandle& node);
...@@ -583,9 +582,8 @@ private: ...@@ -583,9 +582,8 @@ private:
* DbtuxNode.cpp * DbtuxNode.cpp
*/ */
int allocNode(Signal* signal, NodeHandle& node); int allocNode(Signal* signal, NodeHandle& node);
void accessNode(Signal* signal, NodeHandle& node, AccSize acc); void selectNode(Signal* signal, NodeHandle& node, TupLoc loc);
void selectNode(Signal* signal, NodeHandle& node, TupLoc loc, AccSize acc); void insertNode(Signal* signal, NodeHandle& node);
void insertNode(Signal* signal, NodeHandle& node, AccSize acc);
void deleteNode(Signal* signal, NodeHandle& node); void deleteNode(Signal* signal, NodeHandle& node);
void setNodePref(Signal* signal, NodeHandle& node); void setNodePref(Signal* signal, NodeHandle& node);
// node operations // node operations
...@@ -1086,8 +1084,7 @@ inline ...@@ -1086,8 +1084,7 @@ inline
Dbtux::NodeHandle::NodeHandle(Frag& frag) : Dbtux::NodeHandle::NodeHandle(Frag& frag) :
m_frag(frag), m_frag(frag),
m_loc(), m_loc(),
m_node(0), m_node(0)
m_acc(AccNone)
{ {
} }
...@@ -1095,8 +1092,7 @@ inline ...@@ -1095,8 +1092,7 @@ inline
Dbtux::NodeHandle::NodeHandle(const NodeHandle& node) : Dbtux::NodeHandle::NodeHandle(const NodeHandle& node) :
m_frag(node.m_frag), m_frag(node.m_frag),
m_loc(node.m_loc), m_loc(node.m_loc),
m_node(node.m_node), m_node(node.m_node)
m_acc(node.m_acc)
{ {
} }
...@@ -1106,7 +1102,6 @@ Dbtux::NodeHandle::operator=(const NodeHandle& node) ...@@ -1106,7 +1102,6 @@ Dbtux::NodeHandle::operator=(const NodeHandle& node)
ndbassert(&m_frag == &node.m_frag); ndbassert(&m_frag == &node.m_frag);
m_loc = node.m_loc; m_loc = node.m_loc;
m_node = node.m_node; m_node = node.m_node;
m_acc = node.m_acc;
return *this; return *this;
} }
...@@ -1192,7 +1187,6 @@ inline Dbtux::Data ...@@ -1192,7 +1187,6 @@ inline Dbtux::Data
Dbtux::NodeHandle::getPref() Dbtux::NodeHandle::getPref()
{ {
TreeHead& tree = m_frag.m_tree; TreeHead& tree = m_frag.m_tree;
ndbrequire(m_acc >= AccPref);
return tree.getPref(m_node); return tree.getPref(m_node);
} }
...@@ -1203,11 +1197,6 @@ Dbtux::NodeHandle::getEnt(unsigned pos) ...@@ -1203,11 +1197,6 @@ Dbtux::NodeHandle::getEnt(unsigned pos)
TreeEnt* entList = tree.getEntList(m_node); TreeEnt* entList = tree.getEntList(m_node);
const unsigned occup = m_node->m_occup; const unsigned occup = m_node->m_occup;
ndbrequire(pos < occup); ndbrequire(pos < occup);
if (pos == 0 || pos == occup - 1) {
ndbrequire(m_acc >= AccPref)
} else {
ndbrequire(m_acc == AccFull)
}
return entList[(1 + pos) % occup]; return entList[(1 + pos) % occup];
} }
......
...@@ -122,7 +122,7 @@ Dbtux::printNode(Signal* signal, Frag& frag, NdbOut& out, TupLoc loc, PrintPar& ...@@ -122,7 +122,7 @@ Dbtux::printNode(Signal* signal, Frag& frag, NdbOut& out, TupLoc loc, PrintPar&
} }
TreeHead& tree = frag.m_tree; TreeHead& tree = frag.m_tree;
NodeHandle node(frag); NodeHandle node(frag);
selectNode(signal, node, loc, AccFull); selectNode(signal, node, loc);
out << par.m_path << " " << node << endl; out << par.m_path << " " << node << endl;
// check children // check children
PrintPar cpar[2]; PrintPar cpar[2];
...@@ -407,9 +407,7 @@ operator<<(NdbOut& out, const Dbtux::NodeHandle& node) ...@@ -407,9 +407,7 @@ operator<<(NdbOut& out, const Dbtux::NodeHandle& node)
const Dbtux::TreeHead& tree = frag.m_tree; const Dbtux::TreeHead& tree = frag.m_tree;
out << "[NodeHandle " << hex << &node; out << "[NodeHandle " << hex << &node;
out << " [loc " << node.m_loc << "]"; out << " [loc " << node.m_loc << "]";
out << " [acc " << dec << node.m_acc << "]";
out << " [node " << *node.m_node << "]"; out << " [node " << *node.m_node << "]";
if (node.m_acc >= Dbtux::AccPref) {
const Uint32* data; const Uint32* data;
out << " [pref"; out << " [pref";
data = (const Uint32*)node.m_node + Dbtux::NodeHeadSize; data = (const Uint32*)node.m_node + Dbtux::NodeHeadSize;
...@@ -418,17 +416,12 @@ operator<<(NdbOut& out, const Dbtux::NodeHandle& node) ...@@ -418,17 +416,12 @@ operator<<(NdbOut& out, const Dbtux::NodeHandle& node)
out << "]"; out << "]";
out << " [entList"; out << " [entList";
unsigned numpos = node.m_node->m_occup; unsigned numpos = node.m_node->m_occup;
if (node.m_acc < Dbtux::AccFull && numpos > 2) {
numpos = 2;
out << "(" << dec << numpos << ")";
}
data = (const Uint32*)node.m_node + Dbtux::NodeHeadSize + tree.m_prefSize; data = (const Uint32*)node.m_node + Dbtux::NodeHeadSize + tree.m_prefSize;
const Dbtux::TreeEnt* entList = (const Dbtux::TreeEnt*)data; const Dbtux::TreeEnt* entList = (const Dbtux::TreeEnt*)data;
// print entries in logical order // print entries in logical order
for (unsigned pos = 1; pos <= numpos; pos++) for (unsigned pos = 1; pos <= numpos; pos++)
out << " " << entList[pos % numpos]; out << " " << entList[pos % numpos];
out << "]"; out << "]";
}
out << "]"; out << "]";
return out; return out;
} }
......
...@@ -33,30 +33,16 @@ Dbtux::allocNode(Signal* signal, NodeHandle& node) ...@@ -33,30 +33,16 @@ Dbtux::allocNode(Signal* signal, NodeHandle& node)
jam(); jam();
node.m_loc = TupLoc(pageId, pageOffset); node.m_loc = TupLoc(pageId, pageOffset);
node.m_node = reinterpret_cast<TreeNode*>(node32); node.m_node = reinterpret_cast<TreeNode*>(node32);
node.m_acc = AccNone;
ndbrequire(node.m_loc != NullTupLoc && node.m_node != 0); ndbrequire(node.m_loc != NullTupLoc && node.m_node != 0);
} }
return errorCode; return errorCode;
} }
/*
* Access more of the node.
*/
void
Dbtux::accessNode(Signal* signal, NodeHandle& node, AccSize acc)
{
ndbrequire(node.m_loc != NullTupLoc && node.m_node != 0);
if (node.m_acc >= acc)
return;
// XXX could do prefetch
node.m_acc = acc;
}
/* /*
* Set handle to point to existing node. * Set handle to point to existing node.
*/ */
void void
Dbtux::selectNode(Signal* signal, NodeHandle& node, TupLoc loc, AccSize acc) Dbtux::selectNode(Signal* signal, NodeHandle& node, TupLoc loc)
{ {
Frag& frag = node.m_frag; Frag& frag = node.m_frag;
ndbrequire(loc != NullTupLoc); ndbrequire(loc != NullTupLoc);
...@@ -67,21 +53,19 @@ Dbtux::selectNode(Signal* signal, NodeHandle& node, TupLoc loc, AccSize acc) ...@@ -67,21 +53,19 @@ Dbtux::selectNode(Signal* signal, NodeHandle& node, TupLoc loc, AccSize acc)
jamEntry(); jamEntry();
node.m_loc = loc; node.m_loc = loc;
node.m_node = reinterpret_cast<TreeNode*>(node32); node.m_node = reinterpret_cast<TreeNode*>(node32);
node.m_acc = AccNone;
ndbrequire(node.m_loc != NullTupLoc && node.m_node != 0); ndbrequire(node.m_loc != NullTupLoc && node.m_node != 0);
accessNode(signal, node, acc);
} }
/* /*
* Set handle to point to new node. Uses the pre-allocated node. * Set handle to point to new node. Uses the pre-allocated node.
*/ */
void void
Dbtux::insertNode(Signal* signal, NodeHandle& node, AccSize acc) Dbtux::insertNode(Signal* signal, NodeHandle& node)
{ {
Frag& frag = node.m_frag; Frag& frag = node.m_frag;
TupLoc loc = frag.m_freeLoc; TupLoc loc = frag.m_freeLoc;
frag.m_freeLoc = NullTupLoc; frag.m_freeLoc = NullTupLoc;
selectNode(signal, node, loc, acc); selectNode(signal, node, loc);
new (node.m_node) TreeNode(); new (node.m_node) TreeNode();
#ifdef VM_TRACE #ifdef VM_TRACE
TreeHead& tree = frag.m_tree; TreeHead& tree = frag.m_tree;
......
...@@ -275,7 +275,7 @@ Dbtux::execNEXT_SCANREQ(Signal* signal) ...@@ -275,7 +275,7 @@ Dbtux::execNEXT_SCANREQ(Signal* signal)
jam(); jam();
const TupLoc loc = scan.m_scanPos.m_loc; const TupLoc loc = scan.m_scanPos.m_loc;
NodeHandle node(frag); NodeHandle node(frag);
selectNode(signal, node, loc, AccHead); selectNode(signal, node, loc);
unlinkScan(node, scanPtr); unlinkScan(node, scanPtr);
scan.m_scanPos.m_loc = NullTupLoc; scan.m_scanPos.m_loc = NullTupLoc;
} }
...@@ -710,7 +710,7 @@ Dbtux::scanFirst(Signal* signal, ScanOpPtr scanPtr) ...@@ -710,7 +710,7 @@ Dbtux::scanFirst(Signal* signal, ScanOpPtr scanPtr)
scan.m_state = ScanOp::Next; scan.m_state = ScanOp::Next;
// link the scan to node found // link the scan to node found
NodeHandle node(frag); NodeHandle node(frag);
selectNode(signal, node, treePos.m_loc, AccFull); selectNode(signal, node, treePos.m_loc);
linkScan(node, scanPtr); linkScan(node, scanPtr);
} }
...@@ -767,7 +767,7 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr) ...@@ -767,7 +767,7 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr)
TreePos pos = scan.m_scanPos; TreePos pos = scan.m_scanPos;
// get and remember original node // get and remember original node
NodeHandle origNode(frag); NodeHandle origNode(frag);
selectNode(signal, origNode, pos.m_loc, AccHead); selectNode(signal, origNode, pos.m_loc);
ndbrequire(islinkScan(origNode, scanPtr)); ndbrequire(islinkScan(origNode, scanPtr));
// current node in loop // current node in loop
NodeHandle node = origNode; NodeHandle node = origNode;
...@@ -784,7 +784,7 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr) ...@@ -784,7 +784,7 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr)
} }
if (node.m_loc != pos.m_loc) { if (node.m_loc != pos.m_loc) {
jam(); jam();
selectNode(signal, node, pos.m_loc, AccHead); selectNode(signal, node, pos.m_loc);
} }
if (pos.m_dir == 4) { if (pos.m_dir == 4) {
// coming down from parent proceed to left child // coming down from parent proceed to left child
...@@ -811,8 +811,6 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr) ...@@ -811,8 +811,6 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr)
jam(); jam();
unsigned occup = node.getOccup(); unsigned occup = node.getOccup();
ndbrequire(occup >= 1); ndbrequire(occup >= 1);
// access full node
accessNode(signal, node, AccFull);
// advance position // advance position
if (! pos.m_match) if (! pos.m_match)
pos.m_match = true; pos.m_match = true;
......
...@@ -46,7 +46,7 @@ Dbtux::searchToAdd(Signal* signal, Frag& frag, ConstData searchKey, TreeEnt sear ...@@ -46,7 +46,7 @@ Dbtux::searchToAdd(Signal* signal, Frag& frag, ConstData searchKey, TreeEnt sear
NodeHandle bottomNode(frag); NodeHandle bottomNode(frag);
while (true) { while (true) {
jam(); jam();
selectNode(signal, currNode, currNode.m_loc, AccPref); selectNode(signal, currNode, currNode.m_loc);
int ret; int ret;
// compare prefix // compare prefix
unsigned start = 0; unsigned start = 0;
...@@ -100,8 +100,6 @@ Dbtux::searchToAdd(Signal* signal, Frag& frag, ConstData searchKey, TreeEnt sear ...@@ -100,8 +100,6 @@ Dbtux::searchToAdd(Signal* signal, Frag& frag, ConstData searchKey, TreeEnt sear
} }
break; break;
} }
// access rest of current node
accessNode(signal, currNode, AccFull);
// anticipate // anticipate
treePos.m_loc = currNode.m_loc; treePos.m_loc = currNode.m_loc;
// binary search // binary search
...@@ -184,7 +182,7 @@ Dbtux::searchToRemove(Signal* signal, Frag& frag, ConstData searchKey, TreeEnt s ...@@ -184,7 +182,7 @@ Dbtux::searchToRemove(Signal* signal, Frag& frag, ConstData searchKey, TreeEnt s
NodeHandle glbNode(frag); // potential g.l.b of final node NodeHandle glbNode(frag); // potential g.l.b of final node
while (true) { while (true) {
jam(); jam();
selectNode(signal, currNode, currNode.m_loc, AccPref); selectNode(signal, currNode, currNode.m_loc);
int ret; int ret;
// compare prefix // compare prefix
unsigned start = 0; unsigned start = 0;
...@@ -235,8 +233,6 @@ Dbtux::searchToRemove(Signal* signal, Frag& frag, ConstData searchKey, TreeEnt s ...@@ -235,8 +233,6 @@ Dbtux::searchToRemove(Signal* signal, Frag& frag, ConstData searchKey, TreeEnt s
} }
break; break;
} }
// access rest of current node
accessNode(signal, currNode, AccFull);
// anticipate // anticipate
treePos.m_loc = currNode.m_loc; treePos.m_loc = currNode.m_loc;
// pos 0 was handled above // pos 0 was handled above
...@@ -275,7 +271,7 @@ Dbtux::searchToScan(Signal* signal, Frag& frag, ConstData boundInfo, unsigned bo ...@@ -275,7 +271,7 @@ Dbtux::searchToScan(Signal* signal, Frag& frag, ConstData boundInfo, unsigned bo
NodeHandle bottomNode(frag); NodeHandle bottomNode(frag);
while (true) { while (true) {
jam(); jam();
selectNode(signal, currNode, currNode.m_loc, AccPref); selectNode(signal, currNode, currNode.m_loc);
int ret; int ret;
// compare prefix // compare prefix
ret = cmpScanBound(frag, 0, boundInfo, boundCount, currNode.getPref(), tree.m_prefSize); ret = cmpScanBound(frag, 0, boundInfo, boundCount, currNode.getPref(), tree.m_prefSize);
...@@ -324,8 +320,6 @@ Dbtux::searchToScan(Signal* signal, Frag& frag, ConstData boundInfo, unsigned bo ...@@ -324,8 +320,6 @@ Dbtux::searchToScan(Signal* signal, Frag& frag, ConstData boundInfo, unsigned bo
} }
break; break;
} }
// access rest of current node
accessNode(signal, currNode, AccFull);
for (unsigned j = 0, occup = currNode.getOccup(); j < occup; j++) { for (unsigned j = 0, occup = currNode.getOccup(); j < occup; j++) {
jam(); jam();
int ret; int ret;
......
...@@ -29,14 +29,13 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent) ...@@ -29,14 +29,13 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent)
// check for empty tree // check for empty tree
if (treePos.m_loc == NullTupLoc) { if (treePos.m_loc == NullTupLoc) {
jam(); jam();
insertNode(signal, node, AccPref); insertNode(signal, node);
nodePushUp(signal, node, 0, ent); nodePushUp(signal, node, 0, ent);
node.setSide(2); node.setSide(2);
tree.m_root = node.m_loc; tree.m_root = node.m_loc;
return; return;
} }
// access full node selectNode(signal, node, treePos.m_loc);
selectNode(signal, node, treePos.m_loc, AccFull);
// check if it is bounding node // check if it is bounding node
if (pos != 0 && pos != node.getOccup()) { if (pos != 0 && pos != node.getOccup()) {
jam(); jam();
...@@ -59,11 +58,9 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent) ...@@ -59,11 +58,9 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent)
// find glb node // find glb node
while (childLoc != NullTupLoc) { while (childLoc != NullTupLoc) {
jam(); jam();
selectNode(signal, node, childLoc, AccHead); selectNode(signal, node, childLoc);
childLoc = node.getLink(1); childLoc = node.getLink(1);
} }
// access full node again
accessNode(signal, node, AccFull);
pos = node.getOccup(); pos = node.getOccup();
} }
// fall thru to next case // fall thru to next case
...@@ -79,7 +76,7 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent) ...@@ -79,7 +76,7 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent)
} }
// add a new node // add a new node
NodeHandle childNode(frag); NodeHandle childNode(frag);
insertNode(signal, childNode, AccPref); insertNode(signal, childNode);
nodePushUp(signal, childNode, 0, ent); nodePushUp(signal, childNode, 0, ent);
// connect parent and child // connect parent and child
node.setLink(i, childNode.m_loc); node.setLink(i, childNode.m_loc);
...@@ -105,7 +102,7 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent) ...@@ -105,7 +102,7 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent)
// height of longer subtree increased // height of longer subtree increased
jam(); jam();
NodeHandle childNode(frag); NodeHandle childNode(frag);
selectNode(signal, childNode, node.getLink(i), AccHead); selectNode(signal, childNode, node.getLink(i));
int b2 = childNode.getBalance(); int b2 = childNode.getBalance();
if (b2 == b) { if (b2 == b) {
jam(); jam();
...@@ -129,7 +126,7 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent) ...@@ -129,7 +126,7 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent)
break; break;
} }
i = node.getSide(); i = node.getSide();
selectNode(signal, node, parentLoc, AccHead); selectNode(signal, node, parentLoc);
} }
} }
...@@ -142,8 +139,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos) ...@@ -142,8 +139,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
TreeHead& tree = frag.m_tree; TreeHead& tree = frag.m_tree;
unsigned pos = treePos.m_pos; unsigned pos = treePos.m_pos;
NodeHandle node(frag); NodeHandle node(frag);
// access full node selectNode(signal, node, treePos.m_loc);
selectNode(signal, node, treePos.m_loc, AccFull);
TreeEnt ent; TreeEnt ent;
// check interior node first // check interior node first
if (node.getChilds() == 2) { if (node.getChilds() == 2) {
...@@ -161,11 +157,9 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos) ...@@ -161,11 +157,9 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
TupLoc childLoc = node.getLink(0); TupLoc childLoc = node.getLink(0);
while (childLoc != NullTupLoc) { while (childLoc != NullTupLoc) {
jam(); jam();
selectNode(signal, node, childLoc, AccHead); selectNode(signal, node, childLoc);
childLoc = node.getLink(1); childLoc = node.getLink(1);
} }
// access full node again
accessNode(signal, node, AccFull);
// use glb max as new parent min // use glb max as new parent min
ent = node.getEnt(node.getOccup() - 1); ent = node.getEnt(node.getOccup() - 1);
nodePopUp(signal, parentNode, pos, ent); nodePopUp(signal, parentNode, pos, ent);
...@@ -183,7 +177,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos) ...@@ -183,7 +177,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
TupLoc childLoc = node.getLink(i); TupLoc childLoc = node.getLink(i);
if (childLoc != NullTupLoc) { if (childLoc != NullTupLoc) {
// move to child // move to child
selectNode(signal, node, childLoc, AccFull); selectNode(signal, node, childLoc);
// balance of half-leaf parent requires child to be leaf // balance of half-leaf parent requires child to be leaf
break; break;
} }
...@@ -196,7 +190,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos) ...@@ -196,7 +190,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
// move all that fits into parent // move all that fits into parent
if (parentLoc != NullTupLoc) { if (parentLoc != NullTupLoc) {
jam(); jam();
selectNode(signal, parentNode, node.getLink(2), AccFull); selectNode(signal, parentNode, node.getLink(2));
nodeSlide(signal, parentNode, node, i); nodeSlide(signal, parentNode, node, i);
// fall thru to next case // fall thru to next case
} }
...@@ -222,7 +216,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos) ...@@ -222,7 +216,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
// move entries from the other child // move entries from the other child
TupLoc childLoc = node.getLink(1 - i); TupLoc childLoc = node.getLink(1 - i);
NodeHandle childNode(frag); NodeHandle childNode(frag);
selectNode(signal, childNode, childLoc, AccFull); selectNode(signal, childNode, childLoc);
nodeSlide(signal, node, childNode, 1 - i); nodeSlide(signal, node, childNode, 1 - i);
if (childNode.getOccup() == 0) { if (childNode.getOccup() == 0) {
jam(); jam();
...@@ -236,7 +230,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos) ...@@ -236,7 +230,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
} }
// fix side and become parent // fix side and become parent
i = node.getSide(); i = node.getSide();
selectNode(signal, node, parentLoc, AccHead); selectNode(signal, node, parentLoc);
} }
} }
#endif #endif
...@@ -261,7 +255,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos) ...@@ -261,7 +255,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
jam(); jam();
// child on the other side // child on the other side
NodeHandle childNode(frag); NodeHandle childNode(frag);
selectNode(signal, childNode, node.getLink(1 - i), AccHead); selectNode(signal, childNode, node.getLink(1 - i));
int b2 = childNode.getBalance(); int b2 = childNode.getBalance();
if (b2 == b) { if (b2 == b) {
jam(); jam();
...@@ -287,7 +281,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos) ...@@ -287,7 +281,7 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
return; return;
} }
i = node.getSide(); i = node.getSide();
selectNode(signal, node, parentLoc, AccHead); selectNode(signal, node, parentLoc);
} }
} }
...@@ -331,7 +325,7 @@ Dbtux::treeRotateSingle(Signal* signal, ...@@ -331,7 +325,7 @@ Dbtux::treeRotateSingle(Signal* signal,
*/ */
TupLoc loc3 = node5.getLink(i); TupLoc loc3 = node5.getLink(i);
NodeHandle node3(frag); NodeHandle node3(frag);
selectNode(signal, node3, loc3, AccHead); selectNode(signal, node3, loc3);
const int bal3 = node3.getBalance(); const int bal3 = node3.getBalance();
/* /*
2 must always be there but is not changed. Thus we mereley check that it 2 must always be there but is not changed. Thus we mereley check that it
...@@ -348,7 +342,7 @@ Dbtux::treeRotateSingle(Signal* signal, ...@@ -348,7 +342,7 @@ Dbtux::treeRotateSingle(Signal* signal,
NodeHandle node4(frag); NodeHandle node4(frag);
if (loc4 != NullTupLoc) { if (loc4 != NullTupLoc) {
jam(); jam();
selectNode(signal, node4, loc4, AccHead); selectNode(signal, node4, loc4);
ndbrequire(node4.getSide() == (1 - i) && ndbrequire(node4.getSide() == (1 - i) &&
node4.getLink(2) == loc3); node4.getLink(2) == loc3);
node4.setSide(i); node4.setSide(i);
...@@ -383,7 +377,7 @@ Dbtux::treeRotateSingle(Signal* signal, ...@@ -383,7 +377,7 @@ Dbtux::treeRotateSingle(Signal* signal,
if (loc0 != NullTupLoc) { if (loc0 != NullTupLoc) {
jam(); jam();
NodeHandle node0(frag); NodeHandle node0(frag);
selectNode(signal, node0, loc0, AccHead); selectNode(signal, node0, loc0);
node0.setLink(side5, loc3); node0.setLink(side5, loc3);
} else { } else {
jam(); jam();
...@@ -532,13 +526,13 @@ Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i ...@@ -532,13 +526,13 @@ Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i
// level 1 // level 1
TupLoc loc2 = node6.getLink(i); TupLoc loc2 = node6.getLink(i);
NodeHandle node2(frag); NodeHandle node2(frag);
selectNode(signal, node2, loc2, AccHead); selectNode(signal, node2, loc2);
const int bal2 = node2.getBalance(); const int bal2 = node2.getBalance();
// level 2 // level 2
TupLoc loc4 = node2.getLink(1 - i); TupLoc loc4 = node2.getLink(1 - i);
NodeHandle node4(frag); NodeHandle node4(frag);
selectNode(signal, node4, loc4, AccHead); selectNode(signal, node4, loc4);
const int bal4 = node4.getBalance(); const int bal4 = node4.getBalance();
ndbrequire(i <= 1); ndbrequire(i <= 1);
...@@ -556,8 +550,6 @@ Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i ...@@ -556,8 +550,6 @@ Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i
if (loc3 == NullTupLoc && loc5 == NullTupLoc) { if (loc3 == NullTupLoc && loc5 == NullTupLoc) {
jam(); jam();
TreeHead& tree = frag.m_tree; TreeHead& tree = frag.m_tree;
accessNode(signal, node2, AccFull);
accessNode(signal, node4, AccFull);
nodeSlide(signal, node4, node2, i); nodeSlide(signal, node4, node2, i);
// implied by rule of merging half-leaves with leaves // implied by rule of merging half-leaves with leaves
ndbrequire(node4.getOccup() >= tree.m_minOccup); ndbrequire(node4.getOccup() >= tree.m_minOccup);
...@@ -566,14 +558,14 @@ Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i ...@@ -566,14 +558,14 @@ Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i
if (loc3 != NullTupLoc) { if (loc3 != NullTupLoc) {
jam(); jam();
NodeHandle node3(frag); NodeHandle node3(frag);
selectNode(signal, node3, loc3, AccHead); selectNode(signal, node3, loc3);
node3.setLink(2, loc2); node3.setLink(2, loc2);
node3.setSide(1 - i); node3.setSide(1 - i);
} }
if (loc5 != NullTupLoc) { if (loc5 != NullTupLoc) {
jam(); jam();
NodeHandle node5(frag); NodeHandle node5(frag);
selectNode(signal, node5, loc5, AccHead); selectNode(signal, node5, loc5);
node5.setLink(2, node6.m_loc); node5.setLink(2, node6.m_loc);
node5.setSide(i); node5.setSide(i);
} }
...@@ -596,7 +588,7 @@ Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i ...@@ -596,7 +588,7 @@ Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i
if (loc0 != NullTupLoc) { if (loc0 != NullTupLoc) {
jam(); jam();
selectNode(signal, node0, loc0, AccHead); selectNode(signal, node0, loc0);
node0.setLink(side6, loc4); node0.setLink(side6, loc4);
} else { } else {
jam(); jam();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment