Fix result precision deduction of minus expr

This commit is contained in:
Zach41 2024-07-16 09:24:02 +00:00 committed by ob-robot
parent d56b0ed075
commit 34d57ab6f1

View File

@ -98,6 +98,7 @@ int ObExprMinus::calc_result_type2(ObExprResType &type,
int64_t inter_part_length2 = type2.get_precision() - type2.get_scale();
precision = static_cast<ObPrecision>(MAX(inter_part_length1, inter_part_length2)
+ CARRY_OFFSET + scale);
precision = MIN(OB_MAX_DECIMAL_POSSIBLE_PRECISION, precision);
}
}
type.set_scale(scale);