Fix type deduction error
This commit is contained in:
@ -105,6 +105,7 @@ int ObExprAdd::calc_result_type2(ObExprResType &type,
|
|||||||
} else if (is_oracle && type.get_precision() > OB_MAX_NUMBER_PRECISION) {
|
} else if (is_oracle && type.get_precision() > OB_MAX_NUMBER_PRECISION) {
|
||||||
type1.set_calc_type(ObNumberType);
|
type1.set_calc_type(ObNumberType);
|
||||||
type2.set_calc_type(ObNumberType);
|
type2.set_calc_type(ObNumberType);
|
||||||
|
type.set_number();
|
||||||
} else {
|
} else {
|
||||||
if (ObRawExprUtils::decimal_int_need_cast(type1.get_accuracy(), type.get_accuracy()) ||
|
if (ObRawExprUtils::decimal_int_need_cast(type1.get_accuracy(), type.get_accuracy()) ||
|
||||||
ObRawExprUtils::decimal_int_need_cast(type2.get_accuracy(), type.get_accuracy())) {
|
ObRawExprUtils::decimal_int_need_cast(type2.get_accuracy(), type.get_accuracy())) {
|
||||||
|
@ -121,6 +121,7 @@ int ObExprMinus::calc_result_type2(ObExprResType &type,
|
|||||||
} else if (is_oracle && type.get_precision() > OB_MAX_NUMBER_PRECISION) {
|
} else if (is_oracle && type.get_precision() > OB_MAX_NUMBER_PRECISION) {
|
||||||
type1.set_calc_type(ObNumberType);
|
type1.set_calc_type(ObNumberType);
|
||||||
type2.set_calc_type(ObNumberType);
|
type2.set_calc_type(ObNumberType);
|
||||||
|
type.set_number();
|
||||||
} else {
|
} else {
|
||||||
if (ObRawExprUtils::decimal_int_need_cast(type1.get_accuracy(), type.get_accuracy()) ||
|
if (ObRawExprUtils::decimal_int_need_cast(type1.get_accuracy(), type.get_accuracy()) ||
|
||||||
ObRawExprUtils::decimal_int_need_cast(type2.get_accuracy(), type.get_accuracy())) {
|
ObRawExprUtils::decimal_int_need_cast(type2.get_accuracy(), type.get_accuracy())) {
|
||||||
|
@ -105,6 +105,9 @@ int ObExprMul::calc_result_type2(ObExprResType &type,
|
|||||||
} else if (is_oracle && type.get_precision() > OB_MAX_NUMBER_PRECISION) {
|
} else if (is_oracle && type.get_precision() > OB_MAX_NUMBER_PRECISION) {
|
||||||
type1.set_calc_type(ObNumberType);
|
type1.set_calc_type(ObNumberType);
|
||||||
type2.set_calc_type(ObNumberType);
|
type2.set_calc_type(ObNumberType);
|
||||||
|
type.set_number();
|
||||||
|
type.set_scale(ORA_NUMBER_SCALE_UNKNOWN_YET);
|
||||||
|
type.set_precision(PRECISION_UNKNOWN_YET);
|
||||||
} else if ((type1.get_scale() + type2.get_scale() <= OB_MAX_DECIMAL_SCALE)
|
} else if ((type1.get_scale() + type2.get_scale() <= OB_MAX_DECIMAL_SCALE)
|
||||||
&& (type1.get_precision() + type2.get_precision() <= MAX_PRECISION_DECIMAL_INT_256)) {
|
&& (type1.get_precision() + type2.get_precision() <= MAX_PRECISION_DECIMAL_INT_256)) {
|
||||||
// use specialized functions without additional casts
|
// use specialized functions without additional casts
|
||||||
|
Reference in New Issue
Block a user