Commit 87636012 authored by unknown's avatar unknown
Browse files

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 8c206765
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -2449,14 +2449,14 @@ void Dbacc::execACC_COMMITREQ(Signal* signal)
  operationRecPtr.p->transactionstate = IDLE;
  operationRecPtr.p->operation = ZUNDEFINED_OP;
  if(Toperation != ZREAD){
    rootfragrecptr.i = fragrecptr.p->myroot;
    ptrCheckGuard(rootfragrecptr, crootfragmentsize, rootfragmentrec);
    rootfragrecptr.p->m_commit_count++;
    if (Toperation != ZINSERT) {
      if (Toperation != ZDELETE) {
	return;
      } else {
	jam();
	rootfragrecptr.i = fragrecptr.p->myroot;
	ptrCheckGuard(rootfragrecptr, crootfragmentsize, rootfragmentrec);
	rootfragrecptr.p->noOfElements--;
	fragrecptr.p->slack += operationRecPtr.p->insertDeleteLen;
	if (fragrecptr.p->slack > fragrecptr.p->slackCheck) { 
@@ -2476,8 +2476,6 @@ void Dbacc::execACC_COMMITREQ(Signal* signal)
      }//if
    } else {
      jam();  /* EXPAND PROCESS HANDLING */
      rootfragrecptr.i = fragrecptr.p->myroot;
      ptrCheckGuard(rootfragrecptr, crootfragmentsize, rootfragmentrec);
      rootfragrecptr.p->noOfElements++;
      fragrecptr.p->slack -= operationRecPtr.p->insertDeleteLen;
      if (fragrecptr.p->slack >= (1u << 31)) {