Commit 82095bc4 authored by unknown's avatar unknown

Fix uninitialised variable in Dbacc


ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
  Found use of uninitialised variable when increasing m_commit_count.
  Moved initialisation of rootfragrecptr to before increase of m_commit_count, and removed the two initializations further down, since they are now unneccessary.
parent a2b299b0
...@@ -2449,14 +2449,14 @@ void Dbacc::execACC_COMMITREQ(Signal* signal) ...@@ -2449,14 +2449,14 @@ void Dbacc::execACC_COMMITREQ(Signal* signal)
operationRecPtr.p->transactionstate = IDLE; operationRecPtr.p->transactionstate = IDLE;
operationRecPtr.p->operation = ZUNDEFINED_OP; operationRecPtr.p->operation = ZUNDEFINED_OP;
if(Toperation != ZREAD){ if(Toperation != ZREAD){
rootfragrecptr.i = fragrecptr.p->myroot;
ptrCheckGuard(rootfragrecptr, crootfragmentsize, rootfragmentrec);
rootfragrecptr.p->m_commit_count++; rootfragrecptr.p->m_commit_count++;
if (Toperation != ZINSERT) { if (Toperation != ZINSERT) {
if (Toperation != ZDELETE) { if (Toperation != ZDELETE) {
return; return;
} else { } else {
jam(); jam();
rootfragrecptr.i = fragrecptr.p->myroot;
ptrCheckGuard(rootfragrecptr, crootfragmentsize, rootfragmentrec);
rootfragrecptr.p->noOfElements--; rootfragrecptr.p->noOfElements--;
fragrecptr.p->slack += operationRecPtr.p->insertDeleteLen; fragrecptr.p->slack += operationRecPtr.p->insertDeleteLen;
if (fragrecptr.p->slack > fragrecptr.p->slackCheck) { if (fragrecptr.p->slack > fragrecptr.p->slackCheck) {
...@@ -2476,8 +2476,6 @@ void Dbacc::execACC_COMMITREQ(Signal* signal) ...@@ -2476,8 +2476,6 @@ void Dbacc::execACC_COMMITREQ(Signal* signal)
}//if }//if
} else { } else {
jam(); /* EXPAND PROCESS HANDLING */ jam(); /* EXPAND PROCESS HANDLING */
rootfragrecptr.i = fragrecptr.p->myroot;
ptrCheckGuard(rootfragrecptr, crootfragmentsize, rootfragmentrec);
rootfragrecptr.p->noOfElements++; rootfragrecptr.p->noOfElements++;
fragrecptr.p->slack -= operationRecPtr.p->insertDeleteLen; fragrecptr.p->slack -= operationRecPtr.p->insertDeleteLen;
if (fragrecptr.p->slack >= (1u << 31)) { if (fragrecptr.p->slack >= (1u << 31)) {
......
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