fix cast const string as json
This commit is contained in:
parent
28859fa1e7
commit
e019bfb370
@ -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,如果有在这之外的需求,请扩展这个接口的实现
|
||||
* */
|
||||
|
@ -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));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user