Fix 4016 error caused by non-idempotent type deduction of case when

This commit is contained in:
obdev
2024-09-20 07:23:29 +00:00
committed by ob-robot
parent e6e853adef
commit 87f7fda79c

View File

@ -104,8 +104,9 @@ int ObExprCase::calc_result_typeN(ObExprResType &type,
types_stack[i].set_calc_meta(types_stack[i].get_obj_meta());
} else {
types_stack[i].set_calc_meta(type.get_obj_meta());
if (ObDecimalIntType == type.get_obj_meta().get_type() ||
ob_is_double_type(type.get_obj_meta().get_type())) {
if (ObNumberType == type.get_obj_meta().get_type()
|| ObDecimalIntType == type.get_obj_meta().get_type()
|| ob_is_double_type(type.get_obj_meta().get_type())) {
types_stack[i].set_calc_accuracy(type.get_accuracy());
}
}