[CP] [to #52804352] fix bug, case expressions in PL actually do not require parameter types to be consistent

This commit is contained in:
swjtu-wenxiang
2024-01-18 07:17:56 +00:00
committed by ob-robot
parent 7236593e43
commit 39acb953a0

View File

@ -1058,14 +1058,13 @@ int ObExprOperator::aggregate_result_type_for_case(
}
nth = OB_INVALID_ID == nth ? 0 : nth;
const ObExprResType &res_type = types[nth];
if (need_merge_type && lib::is_oracle_mode() && is_called_in_sql
if (need_merge_type && is_called_in_sql
&& ObTinyIntType == types[0].get_type()) {
ret = OB_ERR_CALL_WRONG_ARG;
LOG_WARN("PLS-00306: wrong number or types of arguments in call", K(ret));
}
for (int64_t i = 1; OB_SUCC(ret) && i < param_num; ++i) {
if (need_merge_type && lib::is_oracle_mode() && is_called_in_sql
&& ObTinyIntType == types[i].get_type()) {
for (int64_t i = 1; OB_SUCC(ret) && is_called_in_sql && i < param_num; ++i) {
if (need_merge_type && ObTinyIntType == types[i].get_type()) {
ret = OB_ERR_CALL_WRONG_ARG;
LOG_WARN("PLS-00306: wrong number or types of arguments in call", K(ret));
} else if (OB_FAIL(ObExprOperator::is_same_kind_type_for_case(res_type,