fix: old engine distinct boolean type
This commit is contained in:
@ -66,6 +66,12 @@ int ObExprToType::calc_result1(ObObj& result, const ObObj& obj1, ObExprCtx& expr
|
||||
EXPR_DEFINE_CAST_CTX(expr_ctx, cast_mode_);
|
||||
if (ob_is_json(expect_type_)) {
|
||||
cast_ctx.dest_collation_ = result_type_.get_collation_type();
|
||||
bool is_bool = false;
|
||||
if (OB_FAIL(get_param_is_boolean(expr_ctx, obj1, is_bool))) {
|
||||
LOG_WARN("get is_boolean type failed, bool may be cast as json int", K(ret), K(obj1));
|
||||
} else {
|
||||
cast_ctx.cast_mode_ |= CM_TO_BOOLEAN;
|
||||
}
|
||||
}
|
||||
if (OB_FAIL(ObObjCaster::to_type(expect_type_, cast_ctx, obj1, result))) {
|
||||
LOG_WARN("failed to cast obj", K(ret));
|
||||
@ -119,6 +125,9 @@ int ObExprToType::calc_result_type_for_literal(ObExprResType& type, ObExprResTyp
|
||||
}
|
||||
} else if (lib::is_mysql_mode() && ob_is_json(expect_type_)) {
|
||||
cast_coll_type = CS_TYPE_UTF8MB4_BIN;
|
||||
if (type1.has_result_flag(IS_BOOL_FLAG)) {
|
||||
cast_mode |= CM_TO_BOOLEAN;
|
||||
}
|
||||
}
|
||||
|
||||
ObAccuracy res_accuracy;
|
||||
|
||||
Reference in New Issue
Block a user