[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

@ -54,7 +54,11 @@ int ObExprMod::calc_result_type2(ObExprResType &type,
type.set_scale(SCALE_UNKNOWN_YET);
} else {
type.set_scale(MAX(scale1, scale2));
type.set_precision(MAX(type1.get_precision(),type2.get_precision()));
if (lib::is_mysql_mode() && type.is_double()) {
type.set_precision(ObMySQLUtil::float_length(type.get_scale()));
} else {
type.set_precision(MAX(type1.get_precision(),type2.get_precision()));
}
}
}
return ret;