Fix type deduction error
This commit is contained in:
parent
8d166a7d96
commit
dd4fe92807
@ -105,6 +105,7 @@ int ObExprAdd::calc_result_type2(ObExprResType &type,
|
||||
} else if (is_oracle && type.get_precision() > OB_MAX_NUMBER_PRECISION) {
|
||||
type1.set_calc_type(ObNumberType);
|
||||
type2.set_calc_type(ObNumberType);
|
||||
type.set_number();
|
||||
} else {
|
||||
if (ObRawExprUtils::decimal_int_need_cast(type1.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) {
|
||||
type1.set_calc_type(ObNumberType);
|
||||
type2.set_calc_type(ObNumberType);
|
||||
type.set_number();
|
||||
} else {
|
||||
if (ObRawExprUtils::decimal_int_need_cast(type1.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) {
|
||||
type1.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)
|
||||
&& (type1.get_precision() + type2.get_precision() <= MAX_PRECISION_DECIMAL_INT_256)) {
|
||||
// use specialized functions without additional casts
|
||||
|
Loading…
x
Reference in New Issue
Block a user