Merge branch '3.0' into enh/TS-3737-3.0

This commit is contained in:
kailixu 2024-06-05 09:42:39 +08:00
commit b8069ed33c
3 changed files with 20 additions and 4 deletions

View File

@ -67,7 +67,12 @@ static void clearWinStateBuff(SCountWindowResult* pBuff) {
static SCountWindowResult* getCountWinStateInfo(SCountWindowSupp* pCountSup) { static SCountWindowResult* getCountWinStateInfo(SCountWindowSupp* pCountSup) {
SCountWindowResult* pBuffInfo = taosArrayGet(pCountSup->pWinStates, pCountSup->stateIndex); SCountWindowResult* pBuffInfo = taosArrayGet(pCountSup->pWinStates, pCountSup->stateIndex);
pCountSup->stateIndex = (pCountSup->stateIndex + 1) % taosArrayGetSize(pCountSup->pWinStates); int32_t size = taosArrayGetSize(pCountSup->pWinStates);
// coverity scan
ASSERTS(size > 0, "WinStates is empty");
if (size > 0) {
pCountSup->stateIndex = (pCountSup->stateIndex + 1) % size;
}
return pBuffInfo; return pBuffInfo;
} }

View File

@ -1363,6 +1363,12 @@ static SSDataBlock* readPreVersionData(SOperatorInfo* pTableScanOp, uint64_t tbU
} }
bool comparePrimaryKey(SColumnInfoData* pCol, int32_t rowId, void* pVal) { bool comparePrimaryKey(SColumnInfoData* pCol, int32_t rowId, void* pVal) {
// coverity scan
ASSERTS(pVal != NULL, "pVal should not be NULL");
if (!pVal) {
qError("failed to compare primary key, since primary key is null");
return false;
}
void* pData = colDataGetData(pCol, rowId); void* pData = colDataGetData(pCol, rowId);
if (IS_VAR_DATA_TYPE(pCol->info.type)) { if (IS_VAR_DATA_TYPE(pCol->info.type)) {
int32_t colLen = varDataLen(pData); int32_t colLen = varDataLen(pData);
@ -1469,8 +1475,13 @@ static bool prepareRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pBlock, int32_
} }
STableScanInfo* pTScanInfo = pInfo->pTableScanOp->info; STableScanInfo* pTScanInfo = pInfo->pTableScanOp->info;
qDebug("prepare range scan start:%" PRId64 ",end:%" PRId64 ",maxVer:%" PRIu64, win.skey, win.ekey, pInfo->pUpdateInfo->maxDataVersion); // coverity scan
ASSERTS(pInfo->pUpdateInfo != NULL, "Failed to set data version, since pInfo->pUpdateInfo is NULL");
if (pInfo->pUpdateInfo) {
qDebug("prepare range scan start:%" PRId64 ",end:%" PRId64 ",maxVer:%" PRIu64, win.skey, win.ekey,
pInfo->pUpdateInfo->maxDataVersion);
resetTableScanInfo(pInfo->pTableScanOp->info, &win, pInfo->pUpdateInfo->maxDataVersion); resetTableScanInfo(pInfo->pTableScanOp->info, &win, pInfo->pUpdateInfo->maxDataVersion);
}
pInfo->pTableScanOp->status = OP_OPENED; pInfo->pTableScanOp->status = OP_OPENED;
return true; return true;
} }

View File

@ -364,7 +364,7 @@ static void doStreamEventAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBl
} }
if (pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE) { if (pInfo->twAggSup.calTrigger == STREAM_TRIGGER_AT_ONCE) {
code = saveResult(curWin.winInfo, pSeUpdated); saveResult(curWin.winInfo, pSeUpdated);
} }
if (pInfo->twAggSup.calTrigger == STREAM_TRIGGER_WINDOW_CLOSE) { if (pInfo->twAggSup.calTrigger == STREAM_TRIGGER_WINDOW_CLOSE) {