diff --git a/src/objit/include/objit/common/ob_item_type.h b/src/objit/include/objit/common/ob_item_type.h index 9e4a70490..7133e447e 100644 --- a/src/objit/include/objit/common/ob_item_type.h +++ b/src/objit/include/objit/common/ob_item_type.h @@ -2791,7 +2791,7 @@ extern const char *get_type_name(int type); #define IS_KEEP_AGGR_FUN(op) ((op) >= T_FUN_KEEP_MAX && (op) <= T_FUN_KEEP_STDDEV) - +#define IS_JSON_COMPATIBLE_OP(op) (IS_COMMON_COMPARISON_OP(op) || (op) == T_OP_ROW || (op) == T_OP_LIKE) /** * @notice: 目前只支持IS_BASIC_CMP_OP这个宏里定义的op type,如果有在这之外的需求,请扩展这个接口的实现 * */ diff --git a/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp b/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp index 09d1fb284..9aff18bd1 100644 --- a/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp +++ b/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp @@ -3966,8 +3966,7 @@ int ObRawExprDeduceType::try_add_cast_expr(RawExprType &parent, } // for consistent with mysql, if const cast as json, should regard as scalar, don't need parse - if (ObStringTC == ori_tc && ObJsonTC == expect_tc - && IS_BASIC_CMP_OP(parent.get_expr_type())) { + if (ObStringTC == ori_tc && ObJsonTC == expect_tc && IS_JSON_COMPATIBLE_OP(parent.get_expr_type())) { uint64_t extra = new_expr->get_extra(); new_expr->set_extra(CM_SET_SQL_AS_JSON_SCALAR(extra)); }