diff --git a/source/libs/executor/src/exchangeoperator.c b/source/libs/executor/src/exchangeoperator.c index 52aa3db0fd..0efdeca5b6 100644 --- a/source/libs/executor/src/exchangeoperator.c +++ b/source/libs/executor/src/exchangeoperator.c @@ -182,10 +182,15 @@ static SSDataBlock* doLoadRemoteDataImpl(SOperatorInfo* pOperator) { } // we have buffered retrieved datablock, return it directly - SSDataBlock** p = taosArrayPop(pExchangeInfo->pResultBlockList); + SSDataBlock* p = NULL; + if (taosArrayGetSize(pExchangeInfo->pResultBlockList) > 0) { + p = taosArrayGetP(pExchangeInfo->pResultBlockList, 0); + taosArrayRemove(pExchangeInfo->pResultBlockList, 0); + } + if (p != NULL) { - taosArrayPush(pExchangeInfo->pRecycledBlocks, p); - return *p; + taosArrayPush(pExchangeInfo->pRecycledBlocks, &p); + return p; } else { if (pExchangeInfo->seqLoadData) { seqLoadRemoteData(pOperator); @@ -196,9 +201,10 @@ static SSDataBlock* doLoadRemoteDataImpl(SOperatorInfo* pOperator) { if (taosArrayGetSize(pExchangeInfo->pResultBlockList) == 0) { return NULL; } else { - p = taosArrayPop(pExchangeInfo->pResultBlockList); + p = taosArrayGetP(pExchangeInfo->pResultBlockList, 0); + taosArrayRemove(pExchangeInfo->pResultBlockList, 0); taosArrayPush(pExchangeInfo->pRecycledBlocks, p); - return *p; + return p; } } } diff --git a/source/libs/executor/src/tsort.c b/source/libs/executor/src/tsort.c index 02f2b15a8f..e0a0b9442e 100644 --- a/source/libs/executor/src/tsort.c +++ b/source/libs/executor/src/tsort.c @@ -801,7 +801,7 @@ STupleHandle* tsortNextTuple(SSortHandle* pHandle) { index = tMergeTreeGetChosenIndex(pHandle->pMergeTree); pSource = pHandle->cmpParam.pSources[index]; - assert(pSource->src.pBlock != NULL); + ASSERT(pSource->src.pBlock != NULL); pHandle->tupleHandle.rowIndex = pSource->src.rowIndex; pHandle->tupleHandle.pBlock = pSource->src.pBlock; diff --git a/source/libs/function/src/detail/tminmax.c b/source/libs/function/src/detail/tminmax.c index e07cd38b65..46e68f46ec 100644 --- a/source/libs/function/src/detail/tminmax.c +++ b/source/libs/function/src/detail/tminmax.c @@ -649,7 +649,7 @@ static void doExtractVal(SColumnInfoData* pCol, int32_t i, int32_t end, SqlFunct } case TSDB_DATA_TYPE_INT: { - const int16_t* pData = (const int16_t*)pCol->pData; + const int32_t* pData = (const int32_t*)pCol->pData; __COMPARE_ACQUIRED_MAX(i, end, pCol->nullbitmap, pData, pCtx, *(int32_t*)&(pBuf->v), &pBuf->tuplePos) break; } diff --git a/source/util/src/tarray.c b/source/util/src/tarray.c index 5703d8f8f4..bcf9a77950 100644 --- a/source/util/src/tarray.c +++ b/source/util/src/tarray.c @@ -17,6 +17,8 @@ #include "tarray.h" #include "tcoding.h" +// todo refactor API + SArray* taosArrayInit(size_t size, size_t elemSize) { assert(elemSize > 0); diff --git a/tests/script/tsim/parser/select_with_tags.sim b/tests/script/tsim/parser/select_with_tags.sim index 62f1771f03..0e777de7e8 100644 --- a/tests/script/tsim/parser/select_with_tags.sim +++ b/tests/script/tsim/parser/select_with_tags.sim @@ -396,7 +396,10 @@ if $row != 12800 then return -1 endi +print $data00 , $data01 + if $data00 != @select_tags_tb0@ then + print expect select_tags_tb0 , actual: $data00 return -1 endi