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

This commit is contained in:
obdev
2024-02-09 16:22:00 +00:00
committed by ob-robot
parent 2e8dda5243
commit cab20fa86b

View File

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