Commit 45d8803b authored by unknown's avatar unknown

ndb - Fix loop over multiple bounds in LQH

      Last part of NDB batching of range scans 
      (now only handler remains)


ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Fix loop over multiple bounds in LQH
parent 3c576cc8
......@@ -6962,6 +6962,7 @@ void Dblqh::execSTORED_PROCREF(Signal* signal)
switch (scanptr.p->scanState) {
case ScanRecord::WAIT_STORED_PROC_SCAN:
jam();
scanptr.p->scanCompletedStatus = ZTRUE;
scanptr.p->scanStoredProcId = signal->theData[2];
tcConnectptr.p->errorCode = errorCode;
closeScanLab(signal);
......@@ -7763,7 +7764,11 @@ void Dblqh::accScanConfScanLab(Signal* signal)
tcConnectptr.p->errorCode = req->errorCode;
}
}
scanptr.p->scanState = ScanRecord::WAIT_STORED_PROC_SCAN;
if(scanptr.p->scanStoredProcId == RNIL)
{
jam();
signal->theData[0] = tcConnectptr.p->tupConnectrec;
signal->theData[1] = tcConnectptr.p->tableref;
signal->theData[2] = scanptr.p->scanSchemaVersion;
......@@ -7800,6 +7805,12 @@ void Dblqh::accScanConfScanLab(Signal* signal)
cfirstfreeAttrinbuf = firstAttr;
tcConnectptr.p->firstAttrinbuf = tcConnectptr.p->lastAttrinbuf = RNIL;
}
}
else
{
jam();
storedProcConfScanLab(signal);
}
}//Dblqh::accScanConfScanLab()
#define print_buf(s,idx,len) {\
......@@ -7857,7 +7868,7 @@ Dblqh::copy_bounds(Uint32 * dst, TcConnectionrec* tcPtrP)
if(len < left)
{
offset = 4 - len;
offset = len;
}
else
{
......@@ -7972,7 +7983,6 @@ void Dblqh::continueFirstScanAfterBlockedLab(Signal* signal)
scanptr.i = tcConnectptr.p->tcScanRec;
c_scanRecordPool.getPtr(scanptr);
scanptr.p->scanState = ScanRecord::WAIT_NEXT_SCAN;
init_acc_ptr_list(scanptr.p);
signal->theData[0] = scanptr.p->scanAccPtr;
signal->theData[1] = RNIL;
signal->theData[2] = NextScanReq::ZSCAN_NEXT;
......@@ -8532,9 +8542,9 @@ void Dblqh::accScanCloseConfLab(Signal* signal)
scanptr.p->scanCompletedStatus != ZTRUE)
{
jam();
ndbout_c("Dont close scan");
//sendScanFragConf(signal, 0);
// Don't delete scan in TUP
releaseActiveFrag(signal);
continueAfterReceivingAllAiLab(signal);
return;
}
scanptr.p->scanState = ScanRecord::WAIT_DELETE_STORED_PROC_ID_SCAN;
......@@ -8630,6 +8640,7 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq)
scanptr.p->scanNumber = ~0;
scanptr.p->scanApiOpPtr = scanFragReq->clientOpPtr;
scanptr.p->m_last_row = 0;
scanptr.p->scanStoredProcId = RNIL;
if (max_rows == 0 || (max_bytes > 0 && max_rows > max_bytes)){
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