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