fix: count error on tag which is null
This commit is contained in:
parent
089aec035c
commit
b9927cce14
|
@ -224,6 +224,7 @@ static int32_t doCopyNItems(struct SColumnInfoData* pColumnInfoData, int32_t cur
|
|||
|
||||
int32_t colDataSetNItems(SColumnInfoData* pColumnInfoData, uint32_t currentRow, const char* pData, uint32_t numOfRows,
|
||||
bool trimValue) {
|
||||
if (currentRow >= numOfRows) return TSDB_CODE_SUCCESS;
|
||||
int32_t len = pColumnInfoData->info.bytes;
|
||||
if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) {
|
||||
len = varDataTLen(pData);
|
||||
|
|
|
@ -684,7 +684,7 @@ void markGroupProcessed(STableScanInfo* pInfo, uint64_t groupId) {
|
|||
static SSDataBlock* getOneRowResultBlock(SExecTaskInfo* pTaskInfo, STableScanBase* pBase, SSDataBlock* pBlock,
|
||||
const STableKeyInfo* tbInfo) {
|
||||
blockDataEmpty(pBlock);
|
||||
pBlock->info.rows = 1;
|
||||
pBlock->info.rows = 0;
|
||||
pBlock->info.id.uid = tbInfo->uid;
|
||||
pBlock->info.id.groupId = tbInfo->groupId;
|
||||
|
||||
|
@ -696,7 +696,7 @@ static SSDataBlock* getOneRowResultBlock(SExecTaskInfo* pTaskInfo, STableScanBas
|
|||
}
|
||||
|
||||
// set tag/tbname
|
||||
doSetTagColumnData(pBase, pBlock, pTaskInfo, pBlock->info.rows);
|
||||
doSetTagColumnData(pBase, pBlock, pTaskInfo, 1);
|
||||
return pBlock;
|
||||
}
|
||||
|
||||
|
|
|
@ -2338,6 +2338,8 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
if(pInput->totalRows == 0) return TSDB_CODE_SUCCESS;
|
||||
|
||||
SColumnDataAgg* pColAgg = (pInput->colDataSMAIsSet) ? pInput->pColumnDataAgg[0] : NULL;
|
||||
|
||||
TSKEY startKey = getRowPTs(pInput->pPTS, 0);
|
||||
|
@ -2647,7 +2649,7 @@ int32_t lastRowFunction(SqlFunctionCtx* pCtx) {
|
|||
int32_t bytes = pInputCol->info.bytes;
|
||||
pInfo->bytes = bytes;
|
||||
|
||||
if (IS_NULL_TYPE(type)) {
|
||||
if (IS_NULL_TYPE(type) || 0 == pInput->totalRows) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -6022,7 +6024,7 @@ int32_t groupKeyFunction(SqlFunctionCtx* pCtx) {
|
|||
goto _group_key_over;
|
||||
}
|
||||
|
||||
if (colDataIsNull_s(pInputCol, startIndex)) {
|
||||
if (pInputCol->pData == NULL || colDataIsNull_s(pInputCol, startIndex)) {
|
||||
pInfo->isNull = true;
|
||||
pInfo->hasResult = true;
|
||||
goto _group_key_over;
|
||||
|
|
Loading…
Reference in New Issue