8000 Exception when comparing collections with utp.ut.expect · Issue #1235 · utPLSQL/utPLSQL · GitHub
[go: up one dir, main page]

Skip to content
Exception when comparing collections with utp.ut.expect #1235
Closed
@SElfimov

Description

@SElfimov

Describe the bug
When comparing collections converted to anydata with utp.ut.expect sometimes we get this error, usually it works correctly.

Provide version info
utPLSQL 3.1.12

Information about client software
not applicable

To Reproduce

Run the below script

-- type creation
/*
create or replace type tp_r_ug_sportsman_invitation_result is object
(
    code              number(18),
    sportsman_name    varchar2(100),
    mobile_phone      varchar2(20),
    err_code          number,
    err_text          varchar2(4000)
);
create or replace type tp_t_ug_sportsman_invitation_result is table of tp_r_ug_sportsman_invitation_result;
*/

declare
    --records to compare
    --record 1
    v_sportsman_invitation_result  tp_t_ug_sportsman_invitation_result := tp_t_ug_sportsman_invitation_result
    (
        tp_r_ug_sportsman_invitation_result
        (
            code            => 1,
            sportsman_name  => 'sportsman_1',
            mobile_phone    => '79666666666',
            err_code        => 1,
            err_text        => null
        )
    );

    --record 2
    v_sportsman_invitation_exp  tp_t_ug_sportsman_invitation_result := tp_t_ug_sportsman_invitation_result
    (
        tp_r_ug_sportsman_invitation_result
        (
            code            => 1,
            sportsman_name  => 'sportsman_1',
            mobile_phone    => '79666666666',
            err_code        => 1,
            err_text        => null
        )
    );
begin
    --check rows in collections
    utp.ut.expect(v_sportsman_invitation_result.count, 'count collection')
          .to_equal(v_sportsman_invitation_exp.count);

    if v_sportsman_invitation_result.count = v_sportsman_invitation_exp.count then

        for i in 1..v_sportsman_invitation_result.count
        loop
            --check values of each part of a record
            utp.ut.expect(v_sportsman_invitation_result(i).sportsman_name, 'sportsman_name(' || i || ')')
                .to_equal(v_sportsman_invitation_exp(i).sportsman_name);
            utp.ut.expect(v_sportsman_invitation_result(i).mobile_phone, 'mobile_phone(' || i || ')')
                .to_equal(v_sportsman_invitation_exp(i).mobile_phone);
            utp.ut.expect(v_sportsman_invitation_result(i).err_code, 'err_code(' || i || ')')
                .to_equal(v_sportsman_invitation_exp(i).err_code);
        end loop;

        --compare 2 collections, here we get the exception
	utp.ut.expect(anydata.convertCollection(v_sportsman_invitation_result), 'Collections equal')
              .to_equal(anydata.convertCollection(v_sportsman_invitation_exp));

    end if;
end;

See the exception:

ORA-06502: PL/SQL: : numeric or value error: character string buffer too small
ORA-06512: на "UTP.UT_DATA_VALUE_ANYDATA", line 98
ORA-06512: на "SYS.DBMS_SQL", line 2146
ORA-06512: на "UTP.UT_CURSOR_DETAILS", line 100
ORA-06512: на "UTP.UT_DATA_VALUE_ANYDATA", line 84
ORA-06512: на "UTP.UT_DATA_VALUE_ANYDATA", line 114
ORA-06512: на "UTP.UT", line 33
ORA-06512: на line 61

Expected behavior

We expect to get collections differences.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0