Fix assign expr type deduce for enumset

This commit is contained in:
hezuojiao
2024-03-07 03:18:55 +00:00
committed by ob-robot
parent 4c5811f762
commit 5700951d28
2 changed files with 6 additions and 0 deletions

View File

@ -8768,6 +8768,8 @@ CAST_FUNC_NAME(geometry, decimalint)
} else {
ObDecimalIntBuilder res_val;
res_val.from((int32_t)0);
ObPrecision out_prec = expr.datum_meta_.precision_;
res_val.extend(wide::ObDecimalIntConstValue::get_int_bytes_by_precision(out_prec));
res_datum.set_decimal_int(res_val.get_decimal_int(), res_val.get_int_bytes());
}
}

View File

@ -53,6 +53,10 @@ int ObExprAssign::calc_result_type2(ObExprResType &type,
type.set_varchar();
type.set_collation_level(common::CS_LEVEL_IMPLICIT);
type.set_collation_type(common::CS_TYPE_BINARY);
} else if (ob_is_enum_or_set_type(value.get_type())) {
type.set_varchar();
type.set_collation_level(value.get_collation_level());
type.set_collation_type(value.get_collation_type());
} else {
type.set_type(val_type);
type.set_collation_level(common::CS_LEVEL_IMPLICIT);