fix aggregate scale for temporal type bug
This commit is contained in:
@ -68,9 +68,9 @@ int ObExprIfNull::calc_result_type2(
|
||||
type.set_accuracy(ObAccuracy::DDL_DEFAULT_ACCURACY[ObIntType].get_accuracy());
|
||||
}
|
||||
|
||||
// set scale
|
||||
ObScale scale1 = type1.get_scale();
|
||||
ObScale scale2 = type2.get_scale();
|
||||
//set scale
|
||||
ObScale scale1 = type1.is_null() ? 0 : type1.get_scale();
|
||||
ObScale scale2 = type2.is_null() ? 0 : type2.get_scale();
|
||||
if (-1 != scale1 && -1 != scale2) {
|
||||
type.set_scale(static_cast<ObScale>(max(scale1, scale2)));
|
||||
} else {
|
||||
|
||||
@ -98,8 +98,8 @@ int ObExprNvl::calc_result_type2(
|
||||
} else {
|
||||
type.set_accuracy(type2.get_accuracy());
|
||||
}
|
||||
ObScale scale1 = type1.get_scale();
|
||||
ObScale scale2 = type2.get_scale();
|
||||
ObScale scale1 = type1.is_null() ? 0 : type1.get_scale();
|
||||
ObScale scale2 = type2.is_null() ? 0 : type2.get_scale();
|
||||
if (-1 != scale1 && -1 != scale2) {
|
||||
type.set_scale(static_cast<ObScale>(max(scale1, scale2)));
|
||||
} else {
|
||||
|
||||
@ -1127,8 +1127,7 @@ int ObExprOperator::aggregate_temporal_accuracy_for_merge(
|
||||
}
|
||||
}
|
||||
if (OB_UNLIKELY(scale < 0)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected scale.", K(ret), K(scale));
|
||||
type.set_scale(ObAccuracy::MAX_ACCURACY2[is_oracle_mode()][type.get_type()].get_scale());
|
||||
} else {
|
||||
type.set_scale(scale);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user