From b2225770bb6458f80c9b0f5e39d8685c7e5c8161 Mon Sep 17 00:00:00 2001 From: wangzhe Date: Mon, 14 Apr 2025 14:26:42 +0800 Subject: [PATCH] =?UTF-8?q?IBYZDV=20varchar=3Dbigint=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E6=8A=A5=E9=94=99value=20out=20of=20range?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/parser/parse_expr.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/backend/parser/parse_expr.cpp b/src/common/backend/parser/parse_expr.cpp index 2220c26c4b..ac497130ca 100644 --- a/src/common/backend/parser/parse_expr.cpp +++ b/src/common/backend/parser/parse_expr.cpp @@ -1523,7 +1523,13 @@ static Node* transformAExprOp(ParseState* pstate, A_Expr* a) lexpr = transformExprRecurse(pstate, lexpr); rexpr = transformExprRecurse(pstate, rexpr); - result = (Node*)make_op(pstate, a->name, lexpr, rexpr, last_srf, a->location); + bool isNumeric = false; + if (DB_IS_CMPT(A_FORMAT) || DB_IS_CMPT(B_FORMAT)) { + Oid ltypeId = exprType(lexpr); + Oid rtypeId = exprType(rexpr); + isNumeric = (IsIntType(ltypeId) && IsCharType(rtypeId)) || (IsIntType(rtypeId) && IsCharType(ltypeId)); + } + result = (Node*)make_op(pstate, a->name, lexpr, rexpr, last_srf, a->location, isNumeric); } return result; -- Gitee