Merge pull request #16729 from taosdata/fix/TD-18975

fix: fix statecount result error
This commit is contained in:
Shengliang Guan 2022-09-07 22:35:28 +08:00 committed by GitHub
commit 76dc3b234d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -4711,7 +4711,7 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) {
colDataAppendNULL(pOutput, i);
// handle selectivity
if (pCtx->subsidiaries.num > 0) {
appendSelectivityValue(pCtx, i, i);
appendSelectivityValue(pCtx, i, pCtx->offset + numOfElems - 1);
}
continue;
}
@ -4724,11 +4724,11 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) {
} else {
pInfo->count = 0;
}
colDataAppend(pOutput, i, (char*)&output, false);
colDataAppend(pOutput, pCtx->offset + numOfElems - 1, (char*)&output, false);
// handle selectivity
if (pCtx->subsidiaries.num > 0) {
appendSelectivityValue(pCtx, i, i);
appendSelectivityValue(pCtx, i, pCtx->offset + numOfElems - 1);
}
}