fix to_type() bug

This commit is contained in:
2149
2023-08-17 10:47:24 +00:00
committed by ob-robot
parent 4fb42a22e8
commit cd3e528819
2 changed files with 5 additions and 21 deletions

View File

@ -76,15 +76,11 @@ int ObExprToNumberBase::calc_result_typeN(ObExprResType &type,
if (param_num == 3) {
types[2].set_calc_type_default_varchar();
}
if (types[0].is_null()) {
type.set_null();
} else {
type.set_type(ObNumberType);
type.set_scale(ORA_NUMBER_SCALE_UNKNOWN_YET);
type.set_precision(PRECISION_UNKNOWN_YET);
}
}
}
return ret;
}
@ -339,12 +335,8 @@ int ObExprToBinaryFloat::calc_result_typeN(ObExprResType &type,
LOG_WARN("input type can not cast to binary_float", K(types[0].get_type()), K(ret));
} else {
types[0].set_calc_type(ObFloatType);
if (types[0].is_null()) {
type.set_null();
} else {
type.set_type(ObFloatType);
}
}
return ret;
}
@ -416,12 +408,8 @@ int ObExprToBinaryDouble::calc_result_typeN(ObExprResType &type,
LOG_WARN("input type can not cast to binary_double", K(types[0].get_type()), K(ret));
} else {
types[0].set_calc_type(ObDoubleType);
if (types[0].is_null()) {
type.set_null();
} else {
type.set_type(ObDoubleType);
}
}
return ret;
}

View File

@ -244,10 +244,6 @@ int ObExprToTemporalBase::calc_result_typeN(ObExprResType &type,
//result type
if (OB_SUCC(ret)) {
type.set_type(get_my_target_obj_type());
if (ObDateTimeType == get_my_target_obj_type() && input_char.is_null()) {
//set to_date(null) to null type
type.set_null();
}
}
//result scale
if (OB_SUCC(ret)) {