diff --git a/dbcon/joblist/batchprimitiveprocessor-jl.cpp b/dbcon/joblist/batchprimitiveprocessor-jl.cpp index 7519858e1..56ee5b984 100644 --- a/dbcon/joblist/batchprimitiveprocessor-jl.cpp +++ b/dbcon/joblist/batchprimitiveprocessor-jl.cpp @@ -351,8 +351,8 @@ void BatchPrimitiveProcessorJL::addElementType(const ElementType& et, uint32_t d absRids[ridCount] = et.first; else { - relRids[ridCount] = et.first & 0x1fff; // 8192 rows per logical block - ridMap |= 1 << (relRids[ridCount] >> 10); // LSB -> 0-1023, MSB -> 7168-8191 + relRids[ridCount] = et.first & 0x1fff; // 8192 rows per logical block + ridMap |= 1 << (relRids[ridCount] >> 9); // LSB -> 0-511, MSB -> 7680-8191 } if (sendValues) diff --git a/dbcon/joblist/batchprimitiveprocessor-jl.h b/dbcon/joblist/batchprimitiveprocessor-jl.h index fc535664d..cdc03e262 100644 --- a/dbcon/joblist/batchprimitiveprocessor-jl.h +++ b/dbcon/joblist/batchprimitiveprocessor-jl.h @@ -297,7 +297,7 @@ private: uint16_t filterCount; uint16_t projectCount; bool needRidsAtDelivery; - uint8_t ridMap; + uint16_t ridMap; // TableBand templateTB; uint32_t tableOID; diff --git a/dbcon/joblist/primitivemsg.h b/dbcon/joblist/primitivemsg.h index 6e78a9092..9aa0ae8d9 100644 --- a/dbcon/joblist/primitivemsg.h +++ b/dbcon/joblist/primitivemsg.h @@ -314,7 +314,7 @@ struct ColByScanRequestHeader ColRequestHeaderDataType colType; uint8_t OutputType; // 1 = RID, 2 = Token, 3 = Both uint8_t BOP; // 0 = N/A, 1 = AND, 2 = OR - uint8_t RidFlags; // a bitmap indicating the rid ranges in the resultM SB => row 7168-8191 + uint16_t RidFlags; // a bitmap indicating the rid ranges in the result MSB => row 7680-8191 uint16_t NOPS; uint16_t NVALS; uint8_t sort; @@ -336,7 +336,7 @@ struct ColByScanRangeRequestHeader ColRequestHeaderDataType colType; uint8_t OutputType; // 1 = RID, 2 = Token, 3 = Both uint8_t BOP; // 0 = N/A, 1 = AND, 2 = OR - uint8_t RidFlags; // a bitmap indicating the rid ranges in the result MSB => row 7168-8191 + uint16_t RidFlags; // a bitmap indicating the rid ranges in the result MSB => row 7680-8191 uint16_t NOPS; uint16_t NVALS; uint8_t sort; @@ -409,7 +409,7 @@ struct ColResultHeader { PrimitiveHeader Hdr; uint64_t LBID; - uint8_t RidFlags; + uint16_t RidFlags; uint16_t NVALS; uint16_t ValidMinMax; // 1 if Min/Max are valid, otherwise 0 uint32_t OutputType; @@ -695,7 +695,7 @@ struct NewColRequestHeader uint8_t OutputType; // OT_DATAVALUE, OT_RID, or OT_BOTH uint8_t BOP; // uint8_t InputFlags; // 1 = interpret each NOP & RID as a pair (deprecated) - uint8_t RidFlags; // a bitmap indicating the rid ranges in the result MSB => row 7168-8191 + uint16_t RidFlags; // a bitmap indicating the rid ranges in the result MSB => row 7680-8191 uint16_t NOPS; uint16_t NVALS; uint8_t sort; //1 to sort @@ -730,7 +730,7 @@ struct NewColResultHeader ISMPacketHeader ism; PrimitiveHeader hdr; uint64_t LBID; - uint8_t RidFlags; + uint16_t RidFlags; uint16_t NVALS; uint16_t ValidMinMax; // 1 if Min/Max are valid, otherwise 0 uint32_t OutputType; diff --git a/primitives/linux-port/column.cpp b/primitives/linux-port/column.cpp index d62e5f7fb..fd5214c0b 100644 --- a/primitives/linux-port/column.cpp +++ b/primitives/linux-port/column.cpp @@ -774,7 +774,7 @@ inline void store(const NewColRequestHeader* in, } #endif - out->RidFlags |= (1 << (rid >> 10)); // set the (row/1024)'th bit + out->RidFlags |= (1 << (rid >> 9)); // set the (row/512)'th bit memcpy(&out8[*written], &rid, 2); *written += 2; } diff --git a/primitives/primproc/batchprimitiveprocessor.cpp b/primitives/primproc/batchprimitiveprocessor.cpp index 5cb5f876f..7bde58dbd 100644 --- a/primitives/primproc/batchprimitiveprocessor.cpp +++ b/primitives/primproc/batchprimitiveprocessor.cpp @@ -525,7 +525,7 @@ void BatchPrimitiveProcessor::resetBPP(ByteStream& bs, const SP_UM_MUTEX& w, for (uint32_t i = 0; i < ridCount; i++) { relRids[i] = absRids[i] - baseRid; - ridMap |= 1 << (relRids[i] >> 10); + ridMap |= 1 << (relRids[i] >> 9); } } else @@ -1481,7 +1481,7 @@ void BatchPrimitiveProcessor::execute() if (accumulator[i]) { relRids[ridCount] = i; - ridMap |= 1 << (relRids[ridCount] >> 10); + ridMap |= 1 << (relRids[ridCount] >> 9); ++ridCount; } } diff --git a/primitives/primproc/batchprimitiveprocessor.h b/primitives/primproc/batchprimitiveprocessor.h index b72001249..0c981cc75 100644 --- a/primitives/primproc/batchprimitiveprocessor.h +++ b/primitives/primproc/batchprimitiveprocessor.h @@ -224,7 +224,7 @@ private: uint16_t filterCount; uint16_t projectCount; bool sendRidsAtDelivery; - uint8_t ridMap; + uint16_t ridMap; bool gotAbsRids; bool gotValues; diff --git a/primitives/primproc/columncommand.cpp b/primitives/primproc/columncommand.cpp index be5d91a99..db563007b 100644 --- a/primitives/primproc/columncommand.cpp +++ b/primitives/primproc/columncommand.cpp @@ -127,7 +127,7 @@ void ColumnCommand::makeScanMsg() primMsg->ism.Size = baseMsgLength; primMsg->NVALS = 0; primMsg->LBID = lbid; - primMsg->RidFlags = 0xFF; + primMsg->RidFlags = 0xFFFF; // cout << "scanning lbid " << lbid << " colwidth = " << primMsg->DataSize << // " filterCount = " << filterCount << " outputType = " << @@ -148,7 +148,7 @@ void ColumnCommand::loadData() { uint32_t wasCached; uint32_t blocksRead; - uint8_t _mask; + uint16_t _mask; uint64_t oidLastLbid = 0; bool lastBlockReached = false; oidLastLbid = getLastLbid(); @@ -161,7 +161,7 @@ void ColumnCommand::loadData() _mask = mask; -// primMsg->RidFlags = 0xff; // disables selective block loading +// primMsg->RidFlags = 0xffff; // disables selective block loading //cout <<__FILE__ << "::issuePrimitive() o: " << getOID() << " l:" << primMsg->LBID << " ll: " << oidLastLbid << endl; for (i = 0; i < colType.colWidth; ++i, _mask <<= shift) @@ -599,30 +599,28 @@ void ColumnCommand::prep(int8_t outputType, bool absRids) // memcpy(primMsg + 1, filterString.buf(), filterString.length()); - - // JFYI This switch results are used by index scan code that is unused - // as of 1.5 switch (colType.colWidth) { case 1: + shift = 16; + mask = 0xFFFF; + break; + + case 2: shift = 8; mask = 0xFF; break; - case 2: + case 4: shift = 4; mask = 0x0F; break; - case 4: + case 8: shift = 2; mask = 0x03; break; - case 8: - shift = 1; - mask = 0x01; - break; case 16: shift = 1; mask = 0x01; diff --git a/primitives/primproc/columncommand.h b/primitives/primproc/columncommand.h index eb51db842..aef33fd43 100644 --- a/primitives/primproc/columncommand.h +++ b/primitives/primproc/columncommand.h @@ -149,7 +149,7 @@ private: int64_t* values; // this is usually bpp->values; RTSCommand needs to use a different container int128_t* wide128Values; - uint8_t mask, shift; // vars for the selective block loader + uint16_t mask, shift; // vars for the selective block loader // counters to decide whether to prefetch or not uint32_t blockCount, loadCount; diff --git a/primitives/primproc/filtercommand.cpp b/primitives/primproc/filtercommand.cpp index 1f7e5f377..2791d9f73 100644 --- a/primitives/primproc/filtercommand.cpp +++ b/primitives/primproc/filtercommand.cpp @@ -285,7 +285,7 @@ void FilterCommand::doFilter() bpp->wide128Values[bpp->ridCount] = bpp->fFiltCmdBinaryValues[0][i]; else bpp->values[bpp->ridCount] = bpp->fFiltCmdValues[0][i]; - bpp->ridMap |= 1 << (bpp->relRids[bpp->ridCount] >> 10); + bpp->ridMap |= 1 << (bpp->relRids[bpp->ridCount] >> 9); bpp->ridCount++; }