diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 680cbbf92937124074775735a92fe0728f7b1d1c..53764e1fdfca2251d7c3a7a8c25b4b3c826a8656 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -59,7 +59,7 @@ void vnodePostClose(SVnode *pVnode); void vnodeSyncCheckTimeout(SVnode *pVnode); void vnodeClose(SVnode *pVnode); int32_t vnodeSyncCommit(SVnode *pVnode); -int32_t vnodeBegin(SVnode* pVnode); +int32_t vnodeBegin(SVnode *pVnode); int32_t vnodeStart(SVnode *pVnode); void vnodeStop(SVnode *pVnode); @@ -137,6 +137,7 @@ typedef struct SMetaFltParam { int16_t type; void *val; bool reverse; + bool equal; int (*filterFunc)(void *a, void *b, int16_t type); } SMetaFltParam; @@ -270,8 +271,8 @@ int32_t tqReaderSetSubmitReq2(STqReader *pReader, void *msgStr, int32_t msgLen, // int32_t tqReaderSetDataMsg(STqReader *pReader, const SSubmitReq *pMsg, int64_t ver); bool tqNextDataBlock2(STqReader *pReader); bool tqNextDataBlockFilterOut2(STqReader *pReader, SHashObj *filterOutUids); -int32_t tqRetrieveDataBlock2(SSDataBlock *pBlock, STqReader *pReader, SSubmitTbData** pSubmitTbDataRet); -int32_t tqRetrieveTaosxBlock2(STqReader *pReader, SArray *blocks, SArray *schemas, SSubmitTbData** pSubmitTbDataRet); +int32_t tqRetrieveDataBlock2(SSDataBlock *pBlock, STqReader *pReader, SSubmitTbData **pSubmitTbDataRet); +int32_t tqRetrieveTaosxBlock2(STqReader *pReader, SArray *blocks, SArray *schemas, SSubmitTbData **pSubmitTbDataRet); // int32_t tqRetrieveDataBlock(SSDataBlock *pBlock, STqReader *pReader); // int32_t tqRetrieveTaosxBlock(STqReader *pReader, SArray *blocks, SArray *schemas); diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c index 1688693d38b360da9bc2d2d0b60f12f27bd038d2..18bd2e02412ab74eddf5b97828a2ca1c0db3b876 100644 --- a/source/dnode/vnode/src/meta/metaQuery.c +++ b/source/dnode/vnode/src/meta/metaQuery.c @@ -1331,7 +1331,11 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) { } taosArrayPush(pUids, &tuid); } else { - if (count >= TRY_ERROR_LIMIT) break; + if (count >= TRY_ERROR_LIMIT) { + if (param->equal == false) { + break; + } + } } count++; valid = param->reverse ? tdbTbcMoveToPrev(pCursor->pCur) : tdbTbcMoveToNext(pCursor->pCur); diff --git a/source/libs/index/src/indexFilter.c b/source/libs/index/src/indexFilter.c index 5c14424b7ecb56a45405cd48daa018a5f8837da9..b6a046bf9d5d8a4f3fbb3c6d0dbacfca1d4cdb51 100644 --- a/source/libs/index/src/indexFilter.c +++ b/source/libs/index/src/indexFilter.c @@ -383,12 +383,18 @@ static FORCE_INLINE int sifEqual(void *a, void *b, int16_t dtype) { //__compar_fn_t func = idxGetCompar(dtype); return (int)tDoCompare(func, QUERY_TERM, a, b); } -static FORCE_INLINE FilterFunc sifGetFilterFunc(EIndexQueryType type, bool *reverse) { +static FORCE_INLINE FilterFunc sifGetFilterFunc(EIndexQueryType type, bool *reverse, bool *equal) { if (type == QUERY_LESS_EQUAL || type == QUERY_LESS_THAN) { *reverse = true; } else { *reverse = false; } + + if (type == QUERY_LESS_EQUAL || type == QUERY_GREATER_EQUAL) { + *equal = true; + } else { + *equal = false; + } if (type == QUERY_LESS_EQUAL) return sifLessEqual; else if (type == QUERY_LESS_THAN) @@ -474,14 +480,15 @@ static int32_t sifDoIndex(SIFParam *left, SIFParam *right, int8_t operType, SIFP ret = indexJsonSearch(arg->ivtIdx, mtm, output->result); indexMultiTermQueryDestroy(mtm); } else { - bool reverse; - FilterFunc filterFunc = sifGetFilterFunc(qtype, &reverse); + bool reverse, equal; + FilterFunc filterFunc = sifGetFilterFunc(qtype, &reverse, &equal); SMetaFltParam param = {.suid = arg->suid, .cid = left->colId, .type = left->colValType, .val = right->condValue, .reverse = reverse, + .equal = equal, .filterFunc = filterFunc}; char buf[128] = {0};