refactor: remove assert.
This commit is contained in:
parent
d83f29dc23
commit
17a5691afb
|
@ -179,7 +179,7 @@ static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, bool* pQueryE
|
||||||
static int32_t getDataBlock(SDataSinkHandle* pHandle, SOutputData* pOutput) {
|
static int32_t getDataBlock(SDataSinkHandle* pHandle, SOutputData* pOutput) {
|
||||||
SDataDeleterHandle* pDeleter = (SDataDeleterHandle*)pHandle;
|
SDataDeleterHandle* pDeleter = (SDataDeleterHandle*)pHandle;
|
||||||
if (NULL == pDeleter->nextOutput.pData) {
|
if (NULL == pDeleter->nextOutput.pData) {
|
||||||
assert(pDeleter->queryEnd);
|
ASSERT(pDeleter->queryEnd);
|
||||||
pOutput->useconds = pDeleter->useconds;
|
pOutput->useconds = pDeleter->useconds;
|
||||||
pOutput->precision = pDeleter->pSchema->precision;
|
pOutput->precision = pDeleter->pSchema->precision;
|
||||||
pOutput->bufStatus = DS_BUF_EMPTY;
|
pOutput->bufStatus = DS_BUF_EMPTY;
|
||||||
|
|
|
@ -181,7 +181,7 @@ static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, bool* pQueryE
|
||||||
static int32_t getDataBlock(SDataSinkHandle* pHandle, SOutputData* pOutput) {
|
static int32_t getDataBlock(SDataSinkHandle* pHandle, SOutputData* pOutput) {
|
||||||
SDataDispatchHandle* pDispatcher = (SDataDispatchHandle*)pHandle;
|
SDataDispatchHandle* pDispatcher = (SDataDispatchHandle*)pHandle;
|
||||||
if (NULL == pDispatcher->nextOutput.pData) {
|
if (NULL == pDispatcher->nextOutput.pData) {
|
||||||
assert(pDispatcher->queryEnd);
|
ASSERT(pDispatcher->queryEnd);
|
||||||
pOutput->useconds = pDispatcher->useconds;
|
pOutput->useconds = pDispatcher->useconds;
|
||||||
pOutput->precision = pDispatcher->pSchema->precision;
|
pOutput->precision = pDispatcher->pSchema->precision;
|
||||||
pOutput->bufStatus = DS_BUF_EMPTY;
|
pOutput->bufStatus = DS_BUF_EMPTY;
|
||||||
|
|
|
@ -88,7 +88,6 @@ void resetResultRow(SResultRow* pResultRow, size_t entrySize) {
|
||||||
|
|
||||||
// TODO refactor: use macro
|
// TODO refactor: use macro
|
||||||
SResultRowEntryInfo* getResultEntryInfo(const SResultRow* pRow, int32_t index, const int32_t* offset) {
|
SResultRowEntryInfo* getResultEntryInfo(const SResultRow* pRow, int32_t index, const int32_t* offset) {
|
||||||
assert(index >= 0 && offset != NULL);
|
|
||||||
return (SResultRowEntryInfo*)((char*)pRow->pEntryInfo + offset[index]);
|
return (SResultRowEntryInfo*)((char*)pRow->pEntryInfo + offset[index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -926,7 +926,6 @@ int32_t setGroupResultOutputBuf(SOperatorInfo* pOperator, SOptrBasicInfo* binfo,
|
||||||
|
|
||||||
SResultRow* pResultRow =
|
SResultRow* pResultRow =
|
||||||
doSetResultOutBufByKey(pBuf, pResultRowInfo, (char*)pData, bytes, true, groupId, pTaskInfo, false, pAggSup, false);
|
doSetResultOutBufByKey(pBuf, pResultRowInfo, (char*)pData, bytes, true, groupId, pTaskInfo, false, pAggSup, false);
|
||||||
assert(pResultRow != NULL);
|
|
||||||
|
|
||||||
setResultRowInitCtx(pResultRow, pCtx, numOfCols, pOperator->exprSupp.rowEntryInfoOffset);
|
setResultRowInitCtx(pResultRow, pCtx, numOfCols, pOperator->exprSupp.rowEntryInfoOffset);
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
|
|
@ -156,7 +156,7 @@ static bool overlapWithTimeWindow(SInterval* pInterval, SDataBlockInfo* pBlockIn
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(w.skey < pBlockInfo->window.skey);
|
ASSERT(w.skey < pBlockInfo->window.skey);
|
||||||
if (pBlockInfo->window.skey <= TMIN(w.ekey, pBlockInfo->window.ekey)) {
|
if (pBlockInfo->window.skey <= TMIN(w.ekey, pBlockInfo->window.ekey)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -408,7 +408,7 @@ static int64_t appendFilledResult(SFillInfo* pFillInfo, SSDataBlock* pBlock, int
|
||||||
|
|
||||||
pFillInfo->numOfTotal += pFillInfo->numOfCurrent;
|
pFillInfo->numOfTotal += pFillInfo->numOfCurrent;
|
||||||
|
|
||||||
assert(pFillInfo->numOfCurrent == resultCapacity);
|
ASSERT(pFillInfo->numOfCurrent == resultCapacity);
|
||||||
return resultCapacity;
|
return resultCapacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -558,7 +558,7 @@ int64_t getNumOfResultsAfterFillGap(SFillInfo* pFillInfo, TSKEY ekey, int32_t ma
|
||||||
numOfRes = taosTimeCountInterval(lastKey, pFillInfo->currentKey, pFillInfo->interval.sliding,
|
numOfRes = taosTimeCountInterval(lastKey, pFillInfo->currentKey, pFillInfo->interval.sliding,
|
||||||
pFillInfo->interval.slidingUnit, pFillInfo->interval.precision);
|
pFillInfo->interval.slidingUnit, pFillInfo->interval.precision);
|
||||||
numOfRes += 1;
|
numOfRes += 1;
|
||||||
assert(numOfRes >= numOfRows);
|
ASSERT(numOfRes >= numOfRows);
|
||||||
} else { // reach the end of data
|
} else { // reach the end of data
|
||||||
if ((ekey1 < pFillInfo->currentKey && FILL_IS_ASC_FILL(pFillInfo)) ||
|
if ((ekey1 < pFillInfo->currentKey && FILL_IS_ASC_FILL(pFillInfo)) ||
|
||||||
(ekey1 >= pFillInfo->currentKey && !FILL_IS_ASC_FILL(pFillInfo))) {
|
(ekey1 >= pFillInfo->currentKey && !FILL_IS_ASC_FILL(pFillInfo))) {
|
||||||
|
@ -593,14 +593,14 @@ int64_t taosFillResultDataBlock(SFillInfo* pFillInfo, SSDataBlock* p, int32_t ca
|
||||||
int32_t remain = taosNumOfRemainRows(pFillInfo);
|
int32_t remain = taosNumOfRemainRows(pFillInfo);
|
||||||
|
|
||||||
int64_t numOfRes = getNumOfResultsAfterFillGap(pFillInfo, pFillInfo->end, capacity);
|
int64_t numOfRes = getNumOfResultsAfterFillGap(pFillInfo, pFillInfo->end, capacity);
|
||||||
assert(numOfRes <= capacity);
|
ASSERT(numOfRes <= capacity);
|
||||||
|
|
||||||
// no data existed for fill operation now, append result according to the fill strategy
|
// no data existed for fill operation now, append result according to the fill strategy
|
||||||
if (remain == 0) {
|
if (remain == 0) {
|
||||||
appendFilledResult(pFillInfo, p, numOfRes);
|
appendFilledResult(pFillInfo, p, numOfRes);
|
||||||
} else {
|
} else {
|
||||||
fillResultImpl(pFillInfo, p, (int32_t)numOfRes);
|
fillResultImpl(pFillInfo, p, (int32_t)numOfRes);
|
||||||
assert(numOfRes == pFillInfo->numOfCurrent);
|
ASSERT(numOfRes == pFillInfo->numOfCurrent);
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug("fill:%p, generated fill result, src block:%d, index:%d, brange:%" PRId64 "-%" PRId64 ", currentKey:%" PRId64
|
qDebug("fill:%p, generated fill result, src block:%d, index:%d, brange:%" PRId64 "-%" PRId64 ", currentKey:%" PRId64
|
||||||
|
|
|
@ -229,7 +229,7 @@ static int32_t doAddToBuf(SSDataBlock* pDataBlock, SSortHandle* pHandle) {
|
||||||
taosArrayPush(pPageIdList, &pageId);
|
taosArrayPush(pPageIdList, &pageId);
|
||||||
|
|
||||||
int32_t size = blockDataGetSize(p) + sizeof(int32_t) + taosArrayGetSize(p->pDataBlock) * sizeof(int32_t);
|
int32_t size = blockDataGetSize(p) + sizeof(int32_t) + taosArrayGetSize(p->pDataBlock) * sizeof(int32_t);
|
||||||
assert(size <= getBufPageSize(pHandle->pBuf));
|
ASSERT(size <= getBufPageSize(pHandle->pBuf));
|
||||||
|
|
||||||
blockDataToBuf(pPage, p);
|
blockDataToBuf(pPage, p);
|
||||||
|
|
||||||
|
@ -592,7 +592,7 @@ static int32_t doInternalMergeSort(SSortHandle* pHandle) {
|
||||||
|
|
||||||
int32_t size =
|
int32_t size =
|
||||||
blockDataGetSize(pDataBlock) + sizeof(int32_t) + taosArrayGetSize(pDataBlock->pDataBlock) * sizeof(int32_t);
|
blockDataGetSize(pDataBlock) + sizeof(int32_t) + taosArrayGetSize(pDataBlock->pDataBlock) * sizeof(int32_t);
|
||||||
assert(size <= getBufPageSize(pHandle->pBuf));
|
ASSERT(size <= getBufPageSize(pHandle->pBuf));
|
||||||
|
|
||||||
blockDataToBuf(pPage, pDataBlock);
|
blockDataToBuf(pPage, pDataBlock);
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,6 @@ void dfaAdd(FstDfa *dfa, FstSparseSet *set, uint32_t ip) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bool succ = sparSetAdd(set, ip, NULL);
|
bool succ = sparSetAdd(set, ip, NULL);
|
||||||
// assert(succ == true);
|
|
||||||
Inst *inst = taosArrayGet(dfa->insts, ip);
|
Inst *inst = taosArrayGet(dfa->insts, ip);
|
||||||
if (inst->ty == MATCH || inst->ty == RANGE) {
|
if (inst->ty == MATCH || inst->ty == RANGE) {
|
||||||
// do nothing
|
// do nothing
|
||||||
|
|
|
@ -1662,73 +1662,6 @@ int32_t charLengthFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam
|
||||||
return doLengthFunction(pInput, inputNum, pOutput, tcharlength);
|
return doLengthFunction(pInput, inputNum, pOutput, tcharlength);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static void reverseCopy(char* dest, const char* src, int16_t type, int32_t numOfRows) {
|
|
||||||
switch(type) {
|
|
||||||
case TSDB_DATA_TYPE_TINYINT:
|
|
||||||
case TSDB_DATA_TYPE_UTINYINT:{
|
|
||||||
int8_t* p = (int8_t*) dest;
|
|
||||||
int8_t* pSrc = (int8_t*) src;
|
|
||||||
|
|
||||||
for(int32_t i = 0; i < numOfRows; ++i) {
|
|
||||||
p[i] = pSrc[numOfRows - i - 1];
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_SMALLINT:
|
|
||||||
case TSDB_DATA_TYPE_USMALLINT:{
|
|
||||||
int16_t* p = (int16_t*) dest;
|
|
||||||
int16_t* pSrc = (int16_t*) src;
|
|
||||||
|
|
||||||
for(int32_t i = 0; i < numOfRows; ++i) {
|
|
||||||
p[i] = pSrc[numOfRows - i - 1];
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
case TSDB_DATA_TYPE_INT:
|
|
||||||
case TSDB_DATA_TYPE_UINT: {
|
|
||||||
int32_t* p = (int32_t*) dest;
|
|
||||||
int32_t* pSrc = (int32_t*) src;
|
|
||||||
|
|
||||||
for(int32_t i = 0; i < numOfRows; ++i) {
|
|
||||||
p[i] = pSrc[numOfRows - i - 1];
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
case TSDB_DATA_TYPE_BIGINT:
|
|
||||||
case TSDB_DATA_TYPE_UBIGINT: {
|
|
||||||
int64_t* p = (int64_t*) dest;
|
|
||||||
int64_t* pSrc = (int64_t*) src;
|
|
||||||
|
|
||||||
for(int32_t i = 0; i < numOfRows; ++i) {
|
|
||||||
p[i] = pSrc[numOfRows - i - 1];
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
case TSDB_DATA_TYPE_FLOAT: {
|
|
||||||
float* p = (float*) dest;
|
|
||||||
float* pSrc = (float*) src;
|
|
||||||
|
|
||||||
for(int32_t i = 0; i < numOfRows; ++i) {
|
|
||||||
p[i] = pSrc[numOfRows - i - 1];
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
case TSDB_DATA_TYPE_DOUBLE: {
|
|
||||||
double* p = (double*) dest;
|
|
||||||
double* pSrc = (double*) src;
|
|
||||||
|
|
||||||
for(int32_t i = 0; i < numOfRows; ++i) {
|
|
||||||
p[i] = pSrc[numOfRows - i - 1];
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
default: assert(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool getTimePseudoFuncEnv(SFunctionNode *UNUSED_PARAM(pFunc), SFuncExecEnv *pEnv) {
|
bool getTimePseudoFuncEnv(SFunctionNode *UNUSED_PARAM(pFunc), SFuncExecEnv *pEnv) {
|
||||||
pEnv->calcMemSize = sizeof(int64_t);
|
pEnv->calcMemSize = sizeof(int64_t);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -243,11 +243,6 @@ static FORCE_INLINE STrashElem *doRemoveElemInTrashcan(SCacheObj *pCacheObj, STr
|
||||||
if (next) {
|
if (next) {
|
||||||
next->prev = pElem->prev;
|
next->prev = pElem->prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (pCacheObj->numOfElemsInTrash == 0) {
|
|
||||||
// assert(pCacheObj->pTrash == NULL);
|
|
||||||
// }
|
|
||||||
|
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -545,7 +545,6 @@ void taosHashClear(SHashObj *pHashObj) {
|
||||||
for (int32_t i = 0; i < pHashObj->capacity; ++i) {
|
for (int32_t i = 0; i < pHashObj->capacity; ++i) {
|
||||||
SHashEntry *pEntry = pHashObj->hashList[i];
|
SHashEntry *pEntry = pHashObj->hashList[i];
|
||||||
if (pEntry->num == 0) {
|
if (pEntry->num == 0) {
|
||||||
assert(pEntry->next == NULL);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -646,7 +645,6 @@ void taosHashTableResize(SHashObj *pHashObj) {
|
||||||
SHashNode *pPrev = NULL;
|
SHashNode *pPrev = NULL;
|
||||||
|
|
||||||
if (pe->num == 0) {
|
if (pe->num == 0) {
|
||||||
assert(pe->next == NULL);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,6 @@ SListNode *tdListPopNode(SList *list, SListNode *node) {
|
||||||
|
|
||||||
// Move all node elements from src to dst, the dst is assumed as an empty list
|
// Move all node elements from src to dst, the dst is assumed as an empty list
|
||||||
void tdListMove(SList *src, SList *dst) {
|
void tdListMove(SList *src, SList *dst) {
|
||||||
// assert(dst->eleSize == src->eleSize);
|
|
||||||
SListNode *node = NULL;
|
SListNode *node = NULL;
|
||||||
while ((node = tdListPopHead(src)) != NULL) {
|
while ((node = tdListPopHead(src)) != NULL) {
|
||||||
tdListAppendNode(dst, node);
|
tdListAppendNode(dst, node);
|
||||||
|
|
Loading…
Reference in New Issue