From 11234eccb55dd7f00b4c639b30eea672d7fa700d Mon Sep 17 00:00:00 2001 From: "joreland@mysql.com" <> Date: Wed, 15 Dec 2004 09:11:33 +0100 Subject: [PATCH] wl2240 - ndb partitioning, bug fixes --- ndb/src/common/debugger/signaldata/ScanTab.cpp | 10 +++++++--- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 2 ++ ndb/src/ndbapi/NdbScanOperation.cpp | 3 ++- ndb/tools/select_count.cpp | 9 +++++---- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ndb/src/common/debugger/signaldata/ScanTab.cpp b/ndb/src/common/debugger/signaldata/ScanTab.cpp index 0755ee0a856..941d6a1514e 100644 --- a/ndb/src/common/debugger/signaldata/ScanTab.cpp +++ b/ndb/src/common/debugger/signaldata/ScanTab.cpp @@ -30,20 +30,24 @@ printSCANTABREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiv fprintf(output, " apiConnectPtr: H\'%.8x", sig->apiConnectPtr); fprintf(output, " requestInfo: H\'%.8x:\n", requestInfo); - fprintf(output, " Parallellism: %u, Batch: %u LockMode: %u, Keyinfo: %u Holdlock: %u, RangeScan: %u ReadCommitted: %u\n", + fprintf(output, " Parallellism: %u, Batch: %u LockMode: %u, Keyinfo: %u Holdlock: %u, RangeScan: %u ReadCommitted: %u\n DistributionKeyFlag: %u", sig->getParallelism(requestInfo), sig->getScanBatch(requestInfo), sig->getLockMode(requestInfo), sig->getKeyinfoFlag(requestInfo), sig->getHoldLockFlag(requestInfo), sig->getRangeScanFlag(requestInfo), - sig->getReadCommittedFlag(requestInfo)); + sig->getReadCommittedFlag(requestInfo), + sig->getDistributionKeyFlag(requestInfo)); + + if(sig->getDistributionKeyFlag(requestInfo)) + fprintf(output, " DKey: %u", sig->distributionKey); Uint32 keyLen = (sig->attrLenKeyLen >> 16); Uint32 attrLen = (sig->attrLenKeyLen & 0xFFFF); fprintf(output, " attrLen: %d, keyLen: %d tableId: %d, tableSchemaVer: %d\n", attrLen, keyLen, sig->tableId, sig->tableSchemaVersion); - + fprintf(output, " transId(1, 2): (H\'%.8x, H\'%.8x) storedProcId: H\'%.8x\n", sig->transId1, sig->transId2, sig->storedProcId); fprintf(output, " batch_byte_size: %d, first_batch_size: %d\n", diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 1ce6ffa4817..58233529495 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -8952,6 +8952,7 @@ void Dbtc::execDI_FCOUNTCONF(Signal* signal) { ptr.p->m_ops = 0; ptr.p->m_totalLen = 0; + ptr.p->m_scan_frag_conf_status = 1; ptr.p->scanFragState = ScanFragRec::QUEUED_FOR_DELIVERY; ptr.p->stopFragTimer(); @@ -8959,6 +8960,7 @@ void Dbtc::execDI_FCOUNTCONF(Signal* signal) list.next(ptr); list.remove(tmp); queued.add(tmp); + scanptr.p->m_queued_count++; } }//Dbtc::execDI_FCOUNTCONF() diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 7766068fc3e..d254c696dd0 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -777,8 +777,9 @@ NdbScanOperation::doSendScan(int aProcessorId) Uint32 tmp = req->requestInfo; ScanTabReq::setDistributionKeyFlag(tmp, theDistrKeyIndicator_); req->distributionKey = theDistributionKey; + req->requestInfo = tmp; tSignal->setLength(ScanTabReq::StaticLength + theDistrKeyIndicator_); - + TransporterFacade *tp = TransporterFacade::instance(); LinearSectionPtr ptr[3]; ptr[0].p = m_prepared_receivers; diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index c3491f842d8..9fd3dd3f3b9 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -30,7 +30,7 @@ static int select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism, int* count_rows, - UtilTransactions::ScanLock lock); + NdbOperation::LockMode lock); static const char* opt_connect_str= 0; static const char* _dbname = "TEST_DB"; @@ -116,7 +116,7 @@ int main(int argc, char** argv){ int rows = 0; if (select_count(&MyNdb, pTab, _parallelism, &rows, - (UtilTransactions::ScanLock)_lock) != 0){ + (NdbOperation::LockMode)_lock) != 0){ return NDBT_ProgramExit(NDBT_FAILED); } @@ -129,7 +129,7 @@ int select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism, int* count_rows, - UtilTransactions::ScanLock lock){ + NdbOperation::LockMode lock){ int retryAttempt = 0; const int retryMax = 100; @@ -180,8 +180,9 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, } Uint64 tmp; + Uint32 row_size; pOp->getValue(NdbDictionary::Column::ROW_COUNT, (char*)&tmp); - + pOp->getValue(NdbDictionary::Column::ROW_SIZE, (char*)&row_size); check = pTrans->execute(NoCommit); if( check == -1 ) { ERR(pTrans->getNdbError());