Fix decimal int related bugs
This commit is contained in:
@ -101,7 +101,7 @@ int ObExprGetSysVar::calc_result_type2(ObExprResType &type,
|
|||||||
OX(type.set_collation_type(conn_coll));
|
OX(type.set_collation_type(conn_coll));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (ob_is_int_tc(data_type)) {
|
} else if (ob_is_int_uint_tc(data_type)) {
|
||||||
type.set_accuracy(ObAccuracy::MAX_ACCURACY2[lib::is_oracle_mode()][data_type]);
|
type.set_accuracy(ObAccuracy::MAX_ACCURACY2[lib::is_oracle_mode()][data_type]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,8 +70,7 @@ int ObExprGetUserVar::calc_result_type1(ObExprResType &type,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (session_var.meta_.is_decimal_int()) {
|
if (session_var.meta_.is_decimal_int()) {
|
||||||
type.set_precision(wide::ObDecimalIntConstValue::get_max_precision_by_int_bytes(
|
type.set_precision(static_cast<ObPrecision>(OB_MAX_DECIMAL_POSSIBLE_PRECISION));
|
||||||
session_var.value_.get_int_bytes()));
|
|
||||||
}
|
}
|
||||||
type.set_collation_level(session_var.meta_.get_collation_level());
|
type.set_collation_level(session_var.meta_.get_collation_level());
|
||||||
type.set_collation_type(session_var.meta_.get_collation_type());
|
type.set_collation_type(session_var.meta_.get_collation_type());
|
||||||
@ -137,6 +136,11 @@ int ObExprGetUserVar::eval_get_user_var(const ObExpr &expr, ObEvalCtx &ctx, ObDa
|
|||||||
if (is_lob_storage(res_obj.get_type())) {
|
if (is_lob_storage(res_obj.get_type())) {
|
||||||
OZ(ob_adjust_lob_datum(res_obj, expr.obj_meta_, ctx.exec_ctx_.get_allocator(), res));
|
OZ(ob_adjust_lob_datum(res_obj, expr.obj_meta_, ctx.exec_ctx_.get_allocator(), res));
|
||||||
}
|
}
|
||||||
|
} else if (sess_obj.is_decimal_int() && sess_obj.get_int_bytes() != sizeof(int512_t)) {
|
||||||
|
ObDecimalIntBuilder res_builder;
|
||||||
|
res_builder.from(sess_obj.get_decimal_int(), sess_obj.get_int_bytes());
|
||||||
|
res_builder.extend(sizeof(int512_t));
|
||||||
|
res.set_decimal_int(res_builder.get_decimal_int(), res_builder.get_int_bytes());
|
||||||
} else {
|
} else {
|
||||||
OZ(res.from_obj(sess_obj));
|
OZ(res.from_obj(sess_obj));
|
||||||
if (is_lob_storage(sess_obj.get_type())) {
|
if (is_lob_storage(sess_obj.get_type())) {
|
||||||
|
|||||||
@ -154,6 +154,8 @@ int ObExprOracleDecode::calc_result_typeN(ObExprResType &type,
|
|||||||
type.set_calc_type(ObVarcharType);
|
type.set_calc_type(ObVarcharType);
|
||||||
} else if (lib::is_oracle_mode() && ob_is_nchar(calc_type.get_type())) {
|
} else if (lib::is_oracle_mode() && ob_is_nchar(calc_type.get_type())) {
|
||||||
type.set_calc_type(ObNVarchar2Type);
|
type.set_calc_type(ObNVarchar2Type);
|
||||||
|
} else if (ob_is_decimal_int_tc(calc_type.get_type())) {
|
||||||
|
type.set_calc_type(ObNumberType);
|
||||||
} else {
|
} else {
|
||||||
// 保留原mysql下的行为
|
// 保留原mysql下的行为
|
||||||
type.set_calc_type(calc_type.get_type());
|
type.set_calc_type(calc_type.get_type());
|
||||||
|
|||||||
Reference in New Issue
Block a user