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) {
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);
}
type.set_type(ObNumberType);
type.set_scale(ORA_NUMBER_SCALE_UNKNOWN_YET);
type.set_precision(PRECISION_UNKNOWN_YET);
}
}
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));
} else {
types[0].set_calc_type(ObFloatType);
if (types[0].is_null()) {
type.set_null();
} else {
type.set_type(ObFloatType);
}
type.set_type(ObFloatType);
}
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));
} else {
types[0].set_calc_type(ObDoubleType);
if (types[0].is_null()) {
type.set_null();
} else {
type.set_type(ObDoubleType);
}
type.set_type(ObDoubleType);
}
return ret;
}