[FEAT MERGE] Support float/double(m, d) in mysql mode

This commit is contained in:
hezuojiao
2022-12-29 12:09:23 +00:00
committed by ob-robot
parent d967637528
commit 26f2754db2
58 changed files with 695 additions and 118 deletions

View File

@ -283,6 +283,9 @@ int ObExprAbs::calc_result_type1(ObExprResType &type, ObExprResType &type1,
if (lib::is_oracle_mode() && (type1.is_varchar_or_char() || type1.is_number_float())) {
type.set_precision(PRECISION_UNKNOWN_YET);
type.set_scale(ORA_NUMBER_SCALE_UNKNOWN_YET);
} else if (lib::is_mysql_mode() && type.is_double() && type1.get_scale() != SCALE_UNKNOWN_YET) {
type.set_scale(type1.get_scale());
type.set_precision(static_cast<ObPrecision>(ObMySQLUtil::float_length(type1.get_scale())));
} else {
type.set_accuracy(type1.get_accuracy());
}