From ed59e85dab4dba5a97d10ac48268a7a63ffe36d6 Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Wed, 11 Dec 2024 16:02:25 +0800 Subject: [PATCH] fix: minus operator resType --- source/libs/scalar/src/scalar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c index b3610d035f..74ede393d8 100644 --- a/source/libs/scalar/src/scalar.c +++ b/source/libs/scalar/src/scalar.c @@ -1673,8 +1673,8 @@ static int32_t sclGetMinusOperatorResType(SOperatorNode *pOp) { if (!IS_MATHABLE_TYPE(((SExprNode *)(pOp->pLeft))->resType.type)) { return TSDB_CODE_TSC_INVALID_OPERATION; } - pOp->node.resType.type = TSDB_DATA_TYPE_DOUBLE; - pOp->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes; + pOp->node.resType.type = ((SExprNode *)(pOp->pLeft))->resType.type; + pOp->node.resType.bytes = tDataTypes[((SExprNode *)(pOp->pLeft))->resType.type].bytes; return TSDB_CODE_SUCCESS; }