提交 45a76575 编写于 作者: O obdev 提交者: ob-robot

Fix type deduction error

上级 0d850e9e
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册