未验证 提交 76dc3b23 编写于 作者: S Shengliang Guan 提交者: GitHub

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

fix: fix statecount result error
...@@ -4711,7 +4711,7 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) { ...@@ -4711,7 +4711,7 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) {
colDataAppendNULL(pOutput, i); colDataAppendNULL(pOutput, i);
// handle selectivity // handle selectivity
if (pCtx->subsidiaries.num > 0) { if (pCtx->subsidiaries.num > 0) {
appendSelectivityValue(pCtx, i, i); appendSelectivityValue(pCtx, i, pCtx->offset + numOfElems - 1);
} }
continue; continue;
} }
...@@ -4724,11 +4724,11 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) { ...@@ -4724,11 +4724,11 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) {
} else { } else {
pInfo->count = 0; pInfo->count = 0;
} }
colDataAppend(pOutput, i, (char*)&output, false); colDataAppend(pOutput, pCtx->offset + numOfElems - 1, (char*)&output, false);
// handle selectivity // handle selectivity
if (pCtx->subsidiaries.num > 0) { if (pCtx->subsidiaries.num > 0) {
appendSelectivityValue(pCtx, i, i); appendSelectivityValue(pCtx, i, pCtx->offset + numOfElems - 1);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册