fix(query): fix value number counting in relational processing.

This commit is contained in:
Haojun Liao 2022-09-21 14:18:27 +08:00
parent 721112140f
commit 6c6e20ff14
1 changed files with 7 additions and 2 deletions

View File

@ -606,6 +606,8 @@ int32_t sclExecLogic(SLogicConditionNode *node, SScalarCtx *ctx, SScalarParam *o
SCL_ERR_JRET(code); SCL_ERR_JRET(code);
} }
int32_t numOfQualified = 0;
bool value = false; bool value = false;
bool complete = true; bool complete = true;
for (int32_t i = 0; i < rowNum; ++i) { for (int32_t i = 0; i < rowNum; ++i) {
@ -631,6 +633,9 @@ int32_t sclExecLogic(SLogicConditionNode *node, SScalarCtx *ctx, SScalarParam *o
if (complete) { if (complete) {
colDataAppend(output->columnData, i, (char*) &value, false); colDataAppend(output->columnData, i, (char*) &value, false);
if (value) {
numOfQualified++;
}
} }
} }
@ -639,8 +644,9 @@ int32_t sclExecLogic(SLogicConditionNode *node, SScalarCtx *ctx, SScalarParam *o
output->numOfRows = 0; output->numOfRows = 0;
} }
_return: output->numOfQualified = numOfQualified;
_return:
sclFreeParamList(params, paramNum); sclFreeParamList(params, paramNum);
SCL_RET(code); SCL_RET(code);
} }
@ -1250,7 +1256,6 @@ int32_t scalarCalculate(SNode *pNode, SArray *pBlockList, SScalarParam *pDst) {
} }
_return: _return:
//nodesDestroyNode(pNode);
sclFreeRes(ctx.pRes); sclFreeRes(ctx.pRes);
return code; return code;
} }