fix cast const string as json

This commit is contained in:
linbo-lin 2024-10-18 12:14:09 +00:00 committed by ob-robot
parent 28859fa1e7
commit e019bfb370
2 changed files with 2 additions and 3 deletions

View File

@ -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
* */

View File

@ -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));
}