提交 8537449f 编写于 作者: G Ganlin Zhao

fix diff function selectivity output index

上级 db48f118
...@@ -1682,7 +1682,7 @@ void releaseSource(STuplePos* pPos) { ...@@ -1682,7 +1682,7 @@ void releaseSource(STuplePos* pPos) {
// This function append the selectivity to subsidiaries function context directly, without fetching data // This function append the selectivity to subsidiaries function context directly, without fetching data
// from intermediate disk based buf page // from intermediate disk based buf page
void appendSelectivityValue(SqlFunctionCtx* pCtx, int32_t rowIndex) { void appendSelectivityValue(SqlFunctionCtx* pCtx, int32_t rowIndex, int32_t pos) {
if (pCtx->subsidiaries.num <= 0) { if (pCtx->subsidiaries.num <= 0) {
return; return;
} }
...@@ -1705,9 +1705,9 @@ void appendSelectivityValue(SqlFunctionCtx* pCtx, int32_t rowIndex) { ...@@ -1705,9 +1705,9 @@ void appendSelectivityValue(SqlFunctionCtx* pCtx, int32_t rowIndex) {
ASSERT(pc->pExpr->base.resSchema.bytes == pDstCol->info.bytes); ASSERT(pc->pExpr->base.resSchema.bytes == pDstCol->info.bytes);
if (colDataIsNull_s(pSrcCol, rowIndex) == true) { if (colDataIsNull_s(pSrcCol, rowIndex) == true) {
colDataAppendNULL(pDstCol, rowIndex); colDataAppendNULL(pDstCol, pos);
} else { } else {
colDataAppend(pDstCol, rowIndex, pData, false); colDataAppend(pDstCol, pos, pData, false);
} }
} }
...@@ -3284,7 +3284,9 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) { ...@@ -3284,7 +3284,9 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
if (pDiffInfo->hasPrev) { if (pDiffInfo->hasPrev) {
doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order); doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order);
// handle selectivity // handle selectivity
appendSelectivityValue(pCtx, pos); if (pCtx->subsidiaries.num > 0) {
appendSelectivityValue(pCtx, i, pos);
}
numOfElems++; numOfElems++;
} else { } else {
...@@ -3312,7 +3314,9 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) { ...@@ -3312,7 +3314,9 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
if (pDiffInfo->hasPrev) { if (pDiffInfo->hasPrev) {
doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order); doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order);
// handle selectivity // handle selectivity
appendSelectivityValue(pCtx, pos); if (pCtx->subsidiaries.num > 0) {
appendSelectivityValue(pCtx, i, pos);
}
numOfElems++; numOfElems++;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册