← 输入框|github.com|刷新
Skip to content

Getting "ORA-01031: insufficient privileges" in release v3.1.4 when using SYS_REFCURSOR #864

Closed

Description

@Mikhail5544

Hello!

We have "ORA-01031: insufficient privileges" in release v3.1.4 when using SYS_REFCURSOR in ut.expect. Example below.

create table test_table (id number);
CREATE OR REPLACE PACKAGE  tp_test_grants IS
 --%suite(Grants testing)

 --%test(Test grants)
 PROCEDURE test_test_grants;

end;
/
CREATE OR REPLACE PACKAGE BODY tp_test_grants IS

  

  PROCEDURE test_test_grants IS
    
    v_details_cur    SYS_REFCURSOR;
  BEGIN
    
    OPEN v_details_cur FOR
SELECT * from test_table;

ut.expect(v_details_cur).not_to(be_empty);

END test_test_grants;

END tp_test_grants;

We run:
BEGIN
dbms_output.enable(1000000);
ut.run('tp_test_grants.test_test_grants');
rollback;
END;

Get error

Grants testing
Test grants [,009 sec] (FAILED - 1)

Failures:

  1. test_test_grants
    ORA-01031: привилегий недостаточно
    ORA-06512: на "UT3.UT_CURSOR_DETAILS", line 198
    ORA-06512: на "UT3.UT_DATA_VALUE_REFCURSOR", line 114
    ORA-06512: на "UT3.UT_DATA_VALUE", line 56
    ORA-06512: на "UT3.UT_MATCHER", line 67
    ORA-06512: на "UT3.UT_EXPECTATION", line 40
    ORA-06512: на "INS.TP_TEST_GRANTS", line 11
    ORA-06512: на "UT3.UT_CURSOR_DETAILS", line 198
    ORA-06512: на "UT3.UT_DATA_VALUE_REFCURSOR", line 114
    ORA-06512: на "UT3.UT_DATA_VALUE", line 56
    ORA-06512: на "UT3.UT_MATCHER", line 67
    ORA-06512: на "UT3.UT_EXPECTATION", line 40
    ORA-06512: на "INS.TP_TEST_GRANTS", line 11
    ORA-06512: на line 6
    Finished in ,010221 seconds
    1 tests, 0 failed, 1 errored, 0 disabled, 0 warning(s)

Activity

  1. jgebal commented on Mar 20, 2019

    @jgebal
    Member

    Hi @Mikhail5544
    Thanks for reporting this so quickly/
    We're currently investigating why this error sneaked through our tests.
    Will keep you notified.

  2. added this to the v3.1.5 milestone on Mar 20, 2019
  3. jgebal commented on Mar 20, 2019

    @jgebal
    Member

    @Mikhail5544
    Thanks again for finding and reporting this bug so quickly.
    We're working on a testing strategy that will prevent such bugs in the future.

    Release v3.1.5 is resolving the issue you've faced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions