fix assert in builtinsimpl.c
This commit is contained in:
parent
763f702fff
commit
8a2795b57d
|
@ -506,7 +506,6 @@ static int32_t getNumOfElems(SqlFunctionCtx* pCtx) {
|
||||||
SColumnInfoData* pInputCol = pInput->pData[0];
|
SColumnInfoData* pInputCol = pInput->pData[0];
|
||||||
if (pInput->colDataSMAIsSet && pInput->totalRows == pInput->numOfRows && !IS_VAR_DATA_TYPE(pInputCol->info.type)) {
|
if (pInput->colDataSMAIsSet && pInput->totalRows == pInput->numOfRows && !IS_VAR_DATA_TYPE(pInputCol->info.type)) {
|
||||||
numOfElem = pInput->numOfRows - pInput->pColumnDataAgg[0]->numOfNull;
|
numOfElem = pInput->numOfRows - pInput->pColumnDataAgg[0]->numOfNull;
|
||||||
ASSERT(numOfElem >= 0);
|
|
||||||
} else {
|
} else {
|
||||||
if (pInputCol->hasNull) {
|
if (pInputCol->hasNull) {
|
||||||
for (int32_t i = pInput->startRowIndex; i < pInput->startRowIndex + pInput->numOfRows; ++i) {
|
for (int32_t i = pInput->startRowIndex; i < pInput->startRowIndex + pInput->numOfRows; ++i) {
|
||||||
|
@ -596,7 +595,6 @@ int32_t sumFunction(SqlFunctionCtx* pCtx) {
|
||||||
|
|
||||||
if (pInput->colDataSMAIsSet) {
|
if (pInput->colDataSMAIsSet) {
|
||||||
numOfElem = pInput->numOfRows - pAgg->numOfNull;
|
numOfElem = pInput->numOfRows - pAgg->numOfNull;
|
||||||
ASSERT(numOfElem >= 0);
|
|
||||||
|
|
||||||
if (IS_SIGNED_NUMERIC_TYPE(type)) {
|
if (IS_SIGNED_NUMERIC_TYPE(type)) {
|
||||||
pSumRes->isum += pAgg->sum;
|
pSumRes->isum += pAgg->sum;
|
||||||
|
@ -661,7 +659,6 @@ int32_t sumInvertFunction(SqlFunctionCtx* pCtx) {
|
||||||
|
|
||||||
if (pInput->colDataSMAIsSet) {
|
if (pInput->colDataSMAIsSet) {
|
||||||
numOfElem = pInput->numOfRows - pAgg->numOfNull;
|
numOfElem = pInput->numOfRows - pAgg->numOfNull;
|
||||||
ASSERT(numOfElem >= 0);
|
|
||||||
|
|
||||||
if (IS_SIGNED_NUMERIC_TYPE(type)) {
|
if (IS_SIGNED_NUMERIC_TYPE(type)) {
|
||||||
pSumRes->isum -= pAgg->sum;
|
pSumRes->isum -= pAgg->sum;
|
||||||
|
@ -832,7 +829,6 @@ void setSelectivityValue(SqlFunctionCtx* pCtx, SSDataBlock* pBlock, const STuple
|
||||||
int32_t dstSlotId = pc->pExpr->base.resSchema.slotId;
|
int32_t dstSlotId = pc->pExpr->base.resSchema.slotId;
|
||||||
|
|
||||||
SColumnInfoData* pDstCol = taosArrayGet(pBlock->pDataBlock, dstSlotId);
|
SColumnInfoData* pDstCol = taosArrayGet(pBlock->pDataBlock, dstSlotId);
|
||||||
ASSERT(pc->pExpr->base.resSchema.bytes == pDstCol->info.bytes);
|
|
||||||
if (nullList[j]) {
|
if (nullList[j]) {
|
||||||
colDataAppendNULL(pDstCol, rowIndex);
|
colDataAppendNULL(pDstCol, rowIndex);
|
||||||
} else {
|
} else {
|
||||||
|
@ -876,7 +872,6 @@ void appendSelectivityValue(SqlFunctionCtx* pCtx, int32_t rowIndex, int32_t pos)
|
||||||
int32_t dstSlotId = pc->pExpr->base.resSchema.slotId;
|
int32_t dstSlotId = pc->pExpr->base.resSchema.slotId;
|
||||||
|
|
||||||
SColumnInfoData* pDstCol = taosArrayGet(pCtx->pDstBlock->pDataBlock, dstSlotId);
|
SColumnInfoData* pDstCol = taosArrayGet(pCtx->pDstBlock->pDataBlock, dstSlotId);
|
||||||
ASSERT(pc->pExpr->base.resSchema.bytes == pDstCol->info.bytes);
|
|
||||||
|
|
||||||
if (colDataIsNull_s(pSrcCol, rowIndex) == true) {
|
if (colDataIsNull_s(pSrcCol, rowIndex) == true) {
|
||||||
colDataAppendNULL(pDstCol, pos);
|
colDataAppendNULL(pDstCol, pos);
|
||||||
|
@ -1145,7 +1140,9 @@ static void stddevTransferInfo(SStddevRes* pInput, SStddevRes* pOutput) {
|
||||||
int32_t stddevFunctionMerge(SqlFunctionCtx* pCtx) {
|
int32_t stddevFunctionMerge(SqlFunctionCtx* pCtx) {
|
||||||
SInputColumnInfoData* pInput = &pCtx->input;
|
SInputColumnInfoData* pInput = &pCtx->input;
|
||||||
SColumnInfoData* pCol = pInput->pData[0];
|
SColumnInfoData* pCol = pInput->pData[0];
|
||||||
ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY);
|
if (pCol->info.type != TSDB_DATA_TYPE_BINARY) {
|
||||||
|
return TSDB_CODE_FUNC_FUNTION_PARA_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
SStddevRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
SStddevRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
||||||
|
|
||||||
|
@ -1841,7 +1838,9 @@ int32_t apercentileFunctionMerge(SqlFunctionCtx* pCtx) {
|
||||||
SInputColumnInfoData* pInput = &pCtx->input;
|
SInputColumnInfoData* pInput = &pCtx->input;
|
||||||
|
|
||||||
SColumnInfoData* pCol = pInput->pData[0];
|
SColumnInfoData* pCol = pInput->pData[0];
|
||||||
ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY);
|
if (pCol->info.type != TSDB_DATA_TYPE_BINARY) {
|
||||||
|
return TSDB_CODE_FUNC_FUNTION_PARA_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
SAPercentileInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo);
|
SAPercentileInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo);
|
||||||
|
|
||||||
|
@ -2009,9 +2008,6 @@ static void prepareBuf(SqlFunctionCtx* pCtx) {
|
||||||
pCtx->subsidiaries.rowLen = rowLen + pCtx->subsidiaries.num * sizeof(bool);
|
pCtx->subsidiaries.rowLen = rowLen + pCtx->subsidiaries.num * sizeof(bool);
|
||||||
pCtx->subsidiaries.buf = taosMemoryMalloc(pCtx->subsidiaries.rowLen);
|
pCtx->subsidiaries.buf = taosMemoryMalloc(pCtx->subsidiaries.rowLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(pCtx->subsidiaries.buf != NULL);
|
|
||||||
ASSERT(pCtx->subsidiaries.rowLen > 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void firstlastSaveTupleData(const SSDataBlock* pSrcBlock, int32_t rowIndex, SqlFunctionCtx* pCtx,
|
static void firstlastSaveTupleData(const SSDataBlock* pSrcBlock, int32_t rowIndex, SqlFunctionCtx* pCtx,
|
||||||
|
@ -2060,8 +2056,7 @@ int32_t firstFunction(SqlFunctionCtx* pCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// All null data column, return directly.
|
// All null data column, return directly.
|
||||||
if (pInput->colDataSMAIsSet && (pInput->pColumnDataAgg[0]->numOfNull == pInput->totalRows)) {
|
if (pInput->colDataSMAIsSet && (pInput->pColumnDataAgg[0]->numOfNull == pInput->totalRows) && pInputCol->hasNull == true) {
|
||||||
ASSERT(pInputCol->hasNull == true);
|
|
||||||
// save selectivity value for column consisted of all null values
|
// save selectivity value for column consisted of all null values
|
||||||
firstlastSaveTupleData(pCtx->pSrcBlock, pInput->startRowIndex, pCtx, pInfo);
|
firstlastSaveTupleData(pCtx->pSrcBlock, pInput->startRowIndex, pCtx, pInfo);
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -2168,8 +2163,7 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// All null data column, return directly.
|
// All null data column, return directly.
|
||||||
if (pInput->colDataSMAIsSet && (pInput->pColumnDataAgg[0]->numOfNull == pInput->totalRows)) {
|
if (pInput->colDataSMAIsSet && (pInput->pColumnDataAgg[0]->numOfNull == pInput->totalRows) && pInputCol->hasNull == true) {
|
||||||
ASSERT(pInputCol->hasNull == true);
|
|
||||||
// save selectivity value for column consisted of all null values
|
// save selectivity value for column consisted of all null values
|
||||||
firstlastSaveTupleData(pCtx->pSrcBlock, pInput->startRowIndex, pCtx, pInfo);
|
firstlastSaveTupleData(pCtx->pSrcBlock, pInput->startRowIndex, pCtx, pInfo);
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -2333,7 +2327,9 @@ static void firstLastTransferInfo(SqlFunctionCtx* pCtx, SFirstLastRes* pInput, S
|
||||||
static int32_t firstLastFunctionMergeImpl(SqlFunctionCtx* pCtx, bool isFirstQuery) {
|
static int32_t firstLastFunctionMergeImpl(SqlFunctionCtx* pCtx, bool isFirstQuery) {
|
||||||
SInputColumnInfoData* pInput = &pCtx->input;
|
SInputColumnInfoData* pInput = &pCtx->input;
|
||||||
SColumnInfoData* pCol = pInput->pData[0];
|
SColumnInfoData* pCol = pInput->pData[0];
|
||||||
ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY);
|
if (pCol->info.type != TSDB_DATA_TYPE_BINARY) {
|
||||||
|
return TSDB_CODE_FUNC_FUNTION_PARA_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
SFirstLastRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
SFirstLastRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
||||||
|
|
||||||
|
@ -2528,7 +2524,7 @@ bool diffFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void doSetPrevVal(SDiffInfo* pDiffInfo, int32_t type, const char* pv, int64_t ts) {
|
static int32_t doSetPrevVal(SDiffInfo* pDiffInfo, int32_t type, const char* pv, int64_t ts) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TSDB_DATA_TYPE_BOOL:
|
case TSDB_DATA_TYPE_BOOL:
|
||||||
pDiffInfo->prev.i64 = *(bool*)pv ? 1 : 0;
|
pDiffInfo->prev.i64 = *(bool*)pv ? 1 : 0;
|
||||||
|
@ -2553,12 +2549,14 @@ static void doSetPrevVal(SDiffInfo* pDiffInfo, int32_t type, const char* pv, int
|
||||||
pDiffInfo->prev.d64 = *(double*)pv;
|
pDiffInfo->prev.d64 = *(double*)pv;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
return TSDB_CODE_FUNC_FUNTION_PARA_TYPE;
|
||||||
}
|
}
|
||||||
pDiffInfo->prevTs = ts;
|
pDiffInfo->prevTs = ts;
|
||||||
|
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SColumnInfoData* pOutput, int32_t pos,
|
static int32_t doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SColumnInfoData* pOutput, int32_t pos,
|
||||||
int32_t order, int64_t ts) {
|
int32_t order, int64_t ts) {
|
||||||
int32_t factor = (order == TSDB_ORDER_ASC) ? 1 : -1;
|
int32_t factor = (order == TSDB_ORDER_ASC) ? 1 : -1;
|
||||||
pDiffInfo->prevTs = ts;
|
pDiffInfo->prevTs = ts;
|
||||||
|
@ -2633,8 +2631,10 @@ static void doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SCo
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
return TSDB_CODE_FUNC_FUNTION_PARA_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t diffFunction(SqlFunctionCtx* pCtx) {
|
int32_t diffFunction(SqlFunctionCtx* pCtx) {
|
||||||
|
@ -2671,7 +2671,10 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
|
||||||
if (tsList[i] == pDiffInfo->prevTs) {
|
if (tsList[i] == pDiffInfo->prevTs) {
|
||||||
return TSDB_CODE_FUNC_DUP_TIMESTAMP;
|
return TSDB_CODE_FUNC_DUP_TIMESTAMP;
|
||||||
}
|
}
|
||||||
doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order, tsList[i]);
|
int32_t code = doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order, tsList[i]);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
// handle selectivity
|
// handle selectivity
|
||||||
if (pCtx->subsidiaries.num > 0) {
|
if (pCtx->subsidiaries.num > 0) {
|
||||||
appendSelectivityValue(pCtx, i, pos);
|
appendSelectivityValue(pCtx, i, pos);
|
||||||
|
@ -2679,7 +2682,10 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
|
||||||
|
|
||||||
numOfElems++;
|
numOfElems++;
|
||||||
} else {
|
} else {
|
||||||
doSetPrevVal(pDiffInfo, pInputCol->info.type, pv, tsList[i]);
|
int32_t code = doSetPrevVal(pDiffInfo, pInputCol->info.type, pv, tsList[i]);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pDiffInfo->hasPrev = true;
|
pDiffInfo->hasPrev = true;
|
||||||
|
@ -2704,7 +2710,10 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
|
||||||
if (tsList[i] == pDiffInfo->prevTs) {
|
if (tsList[i] == pDiffInfo->prevTs) {
|
||||||
return TSDB_CODE_FUNC_DUP_TIMESTAMP;
|
return TSDB_CODE_FUNC_DUP_TIMESTAMP;
|
||||||
}
|
}
|
||||||
doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order, tsList[i]);
|
int32_t code = doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order, tsList[i]);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
// handle selectivity
|
// handle selectivity
|
||||||
if (pCtx->subsidiaries.num > 0) {
|
if (pCtx->subsidiaries.num > 0) {
|
||||||
appendSelectivityValue(pCtx, i, pos);
|
appendSelectivityValue(pCtx, i, pos);
|
||||||
|
@ -2712,7 +2721,10 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
|
||||||
|
|
||||||
numOfElems++;
|
numOfElems++;
|
||||||
} else {
|
} else {
|
||||||
doSetPrevVal(pDiffInfo, pInputCol->info.type, pv, tsList[i]);
|
int32_t code = doSetPrevVal(pDiffInfo, pInputCol->info.type, pv, tsList[i]);
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pDiffInfo->hasPrev = true;
|
pDiffInfo->hasPrev = true;
|
||||||
|
@ -2967,10 +2979,9 @@ static STuplePos doSaveTupleData(SSerializeDataHandle* pHandle, const void* pBuf
|
||||||
releaseBufPage(pHandle->pBuf, pPage);
|
releaseBufPage(pHandle->pBuf, pPage);
|
||||||
} else {
|
} else {
|
||||||
// other tuple save policy
|
// other tuple save policy
|
||||||
if (streamStateFuncPut(pHandle->pState, &key, pBuf, length) < 0) {
|
if (streamStateFuncPut(pHandle->pState, &key, pBuf, length) >= 0) {
|
||||||
ASSERT(0);
|
p.streamTupleKey = key;
|
||||||
}
|
}
|
||||||
p.streamTupleKey = key;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
|
@ -2982,12 +2993,13 @@ STuplePos saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBloc
|
||||||
STupleKey key;
|
STupleKey key;
|
||||||
if (pCtx->saveHandle.pBuf == NULL) {
|
if (pCtx->saveHandle.pBuf == NULL) {
|
||||||
SColumnInfoData* pColInfo = taosArrayGet(pSrcBlock->pDataBlock, 0);
|
SColumnInfoData* pColInfo = taosArrayGet(pSrcBlock->pDataBlock, 0);
|
||||||
ASSERT(pColInfo->info.type == TSDB_DATA_TYPE_TIMESTAMP);
|
if (pColInfo->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
|
||||||
int64_t skey = *(int64_t*)colDataGetData(pColInfo, rowIndex);
|
int64_t skey = *(int64_t*)colDataGetData(pColInfo, rowIndex);
|
||||||
|
|
||||||
key.groupId = pSrcBlock->info.id.groupId;
|
key.groupId = pSrcBlock->info.id.groupId;
|
||||||
key.ts = skey;
|
key.ts = skey;
|
||||||
key.exprIdx = pCtx->exprIdx;
|
key.exprIdx = pCtx->exprIdx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char* buf = serializeTupleData(pSrcBlock, rowIndex, &pCtx->subsidiaries, pCtx->subsidiaries.buf);
|
char* buf = serializeTupleData(pSrcBlock, rowIndex, &pCtx->subsidiaries, pCtx->subsidiaries.buf);
|
||||||
|
@ -3225,7 +3237,9 @@ static void spreadTransferInfo(SSpreadInfo* pInput, SSpreadInfo* pOutput) {
|
||||||
int32_t spreadFunctionMerge(SqlFunctionCtx* pCtx) {
|
int32_t spreadFunctionMerge(SqlFunctionCtx* pCtx) {
|
||||||
SInputColumnInfoData* pInput = &pCtx->input;
|
SInputColumnInfoData* pInput = &pCtx->input;
|
||||||
SColumnInfoData* pCol = pInput->pData[0];
|
SColumnInfoData* pCol = pInput->pData[0];
|
||||||
ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY);
|
if (pCol->info.type != TSDB_DATA_TYPE_BINARY) {
|
||||||
|
return TSDB_CODE_FUNC_FUNTION_PARA_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
SSpreadInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
SSpreadInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
||||||
|
|
||||||
|
@ -3404,7 +3418,9 @@ static void elapsedTransferInfo(SElapsedInfo* pInput, SElapsedInfo* pOutput) {
|
||||||
int32_t elapsedFunctionMerge(SqlFunctionCtx* pCtx) {
|
int32_t elapsedFunctionMerge(SqlFunctionCtx* pCtx) {
|
||||||
SInputColumnInfoData* pInput = &pCtx->input;
|
SInputColumnInfoData* pInput = &pCtx->input;
|
||||||
SColumnInfoData* pCol = pInput->pData[0];
|
SColumnInfoData* pCol = pInput->pData[0];
|
||||||
ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY);
|
if (pCol->info.type != TSDB_DATA_TYPE_BINARY) {
|
||||||
|
return TSDB_CODE_FUNC_FUNTION_PARA_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
SElapsedInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
SElapsedInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
||||||
|
|
||||||
|
@ -3574,7 +3590,9 @@ static bool getHistogramBinDesc(SHistoFuncInfo* pInfo, char* binDescStr, int8_t
|
||||||
intervals[0] = -INFINITY;
|
intervals[0] = -INFINITY;
|
||||||
intervals[numOfBins - 1] = INFINITY;
|
intervals[numOfBins - 1] = INFINITY;
|
||||||
// in case of desc bin orders, -inf/inf should be swapped
|
// in case of desc bin orders, -inf/inf should be swapped
|
||||||
ASSERT(numOfBins >= 4);
|
if (numOfBins < 4) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (intervals[1] > intervals[numOfBins - 2]) {
|
if (intervals[1] > intervals[numOfBins - 2]) {
|
||||||
TSWAP(intervals[0], intervals[numOfBins - 1]);
|
TSWAP(intervals[0], intervals[numOfBins - 1]);
|
||||||
}
|
}
|
||||||
|
@ -3717,7 +3735,9 @@ static void histogramTransferInfo(SHistoFuncInfo* pInput, SHistoFuncInfo* pOutpu
|
||||||
int32_t histogramFunctionMerge(SqlFunctionCtx* pCtx) {
|
int32_t histogramFunctionMerge(SqlFunctionCtx* pCtx) {
|
||||||
SInputColumnInfoData* pInput = &pCtx->input;
|
SInputColumnInfoData* pInput = &pCtx->input;
|
||||||
SColumnInfoData* pCol = pInput->pData[0];
|
SColumnInfoData* pCol = pInput->pData[0];
|
||||||
ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY);
|
if (pCol->info.type != TSDB_DATA_TYPE_BINARY) {
|
||||||
|
return TSDB_CODE_FUNC_FUNTION_PARA_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
SHistoFuncInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
SHistoFuncInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
||||||
|
|
||||||
|
@ -4099,7 +4119,7 @@ static bool checkStateOp(int8_t op, SColumnInfoData* pCol, int32_t index, SVaria
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
ASSERT(0);
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -4900,11 +4920,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t i = pInput->startRowIndex;
|
int32_t i = pInput->startRowIndex;
|
||||||
if (pCtx->start.key != INT64_MIN) {
|
if (pCtx->start.key != INT64_MIN && last->key == INT64_MIN) {
|
||||||
// ASSERT((pCtx->start.key < tsList[i] && pCtx->order == TSDB_ORDER_ASC) ||
|
|
||||||
// (pCtx->start.key > tsList[i] && pCtx->order == TSDB_ORDER_DESC));
|
|
||||||
|
|
||||||
ASSERT(last->key == INT64_MIN);
|
|
||||||
for (; i < pInput->numOfRows + pInput->startRowIndex; ++i) {
|
for (; i < pInput->numOfRows + pInput->startRowIndex; ++i) {
|
||||||
if (colDataIsNull_f(pInputCol->nullbitmap, i)) {
|
if (colDataIsNull_f(pInputCol->nullbitmap, i)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -5124,7 +5140,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
return TSDB_CODE_FUNC_FUNTION_PARA_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the last interpolated time window value
|
// the last interpolated time window value
|
||||||
|
|
Loading…
Reference in New Issue