Merge pull request #27506 from taosdata/fix/TD-31754

fix(query):init SExprInfo instance first
This commit is contained in:
Pan Wei 2024-08-28 15:41:44 +08:00 committed by GitHub
commit 7d97190b33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -1747,6 +1747,8 @@ static SColumn* createColumn(int32_t blockId, int32_t slotId, int32_t colId, SDa
int32_t createExprFromOneNode(SExprInfo* pExp, SNode* pNode, int16_t slotId) {
int32_t code = TSDB_CODE_SUCCESS;
int32_t lino = 0;
pExp->base.numOfParams = 0;
pExp->base.pParam = NULL;
pExp->pExpr = taosMemoryCalloc(1, sizeof(tExprNode));
QUERY_CHECK_NULL(pExp->pExpr, code, lino, _end, terrno);
@ -1787,6 +1789,7 @@ int32_t createExprFromOneNode(SExprInfo* pExp, SNode* pNode, int16_t slotId) {
createResSchema(pType->type, pType->bytes, slotId, pType->scale, pType->precision, pValNode->node.aliasName);
pExp->base.pParam[0].type = FUNC_PARAM_TYPE_VALUE;
code = nodesValueNodeToVariant(pValNode, &pExp->base.pParam[0].param);
QUERY_CHECK_CODE(code, lino, _end);
} else if (type == QUERY_NODE_FUNCTION) {
pExp->pExpr->nodeType = QUERY_NODE_FUNCTION;
SFunctionNode* pFuncNode = (SFunctionNode*)pNode;

View File

@ -516,6 +516,9 @@ int32_t createFillOperatorInfo(SOperatorInfo* downstream, SFillPhysiNode* pPhyFi
return code;
_error:
if (code != TSDB_CODE_SUCCESS) {
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
}
if (pInfo != NULL) {
destroyFillOperatorInfo(pInfo);
}