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

View File

@ -244,10 +244,6 @@ int ObExprToTemporalBase::calc_result_typeN(ObExprResType &type,
//result type //result type
if (OB_SUCC(ret)) { if (OB_SUCC(ret)) {
type.set_type(get_my_target_obj_type()); 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 //result scale
if (OB_SUCC(ret)) { if (OB_SUCC(ret)) {