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

invalid identifier error thrown when using "join_by" #770

Closed

Description

@PhilippSalvisberg

Here's an example:

CREATE OR REPLACE PACKAGE test_join_by IS

   --%suite

   --%test
   PROCEDURE p;
      
END test_join_by;
/

CREATE OR REPLACE PACKAGE BODY test_join_by IS

   PROCEDURE p IS
      l_actual   sys_refcursor;
      l_expected sys_refcursor;
   BEGIN
      OPEN l_actual FOR 
         SELECT 1       AS PK, 
                'hello' AS text
           FROM DUAL;

      OPEN l_expected FOR 
         SELECT 1       AS PK, 
                'hello' AS text
           FROM DUAL;

      ut.expect(l_actual).to_equal(l_expected)
         .join_by('PK');
   END p;

END test_join_by;
/

SET SERVEROUTPUT ON SIZE UNLIMITED
EXECUTE ut.run('TEST_JOIN_BY');

When running as user SCOTT I get the following output:


Package TEST_JOIN_BY compiled


Package Body TEST_JOIN_BY compiled

test_join_by
  p [.063 sec] (FAILED - 1)
 
Failures:
 
  1) p
      ORA-00904: "UT3_LATEST_RELEASE"."UT_COMPOUND_DATA_HELPER"."GET_HASH": invalid identifier
      ORA-06512: at "UT3_LATEST_RELEASE.UT_COMPOUND_DATA_VALUE", line 235
      ORA-06512: at "UT3_LATEST_RELEASE.UT_DATA_VALUE_REFCURSOR", line 251
      ORA-06512: at "UT3_LATEST_RELEASE.UT_EQUAL", line 236
      ORA-06512: at "UT3_LATEST_RELEASE.UT_EXPECTATION", line 24
      ORA-06512: at "UT3_LATEST_RELEASE.UT_EXPECTATION_COMPOUND", line 189
      ORA-06512: at "SCOTT.TEST_JOIN_BY", line 17
      ORA-06512: at "UT3_LATEST_RELEASE.UT_COMPOUND_DATA_VALUE", line 235
      ORA-06512: at "UT3_LATEST_RELEASE.UT_DATA_VALUE_REFCURSOR", line 251
      ORA-06512: at "UT3_LATEST_RELEASE.UT_EQUAL", line 236
      ORA-06512: at "UT3_LATEST_RELEASE.UT_EXPECTATION", line 24
      ORA-06512: at "UT3_LATEST_RELEASE.UT_EXPECTATION_COMPOUND", line 189
      ORA-06512: at "SCOTT.TEST_JOIN_BY", line 17
      ORA-06512: at line 6
Finished in .065898 seconds
1 tests, 0 failed, 1 errored, 0 disabled, 0 warning(s)
 


PL/SQL procedure successfully completed.

Works when running as ut3, ut3_latest_release or ut3_tester.

I guess some grants are missing.

Activity

  1. jgebal commented on Oct 27, 2018

    @jgebal
    Member

    Is it the same on develop version?

  2. PhilippSalvisberg commented on Oct 27, 2018

    @PhilippSalvisberg
    MemberAuthor

    not tested.

  3. PhilippSalvisberg commented on Oct 27, 2018

    @PhilippSalvisberg
    MemberAuthor

    Quick fix GRANT EXECUTE ON "UT3_LATEST_RELEASE"."UT_COMPOUND_DATA_HELPER" TO PUBLIC;

  4. jgebal commented on Oct 27, 2018

    @jgebal
    Member

    It will be same.
    @lwasylow, I think the merge statement should be moved from ut_compund_data_value into a helper package that runs as authid definer. The same with the insert statement below it.
    That way we don't need to worry about exposing (granting) internal elements of framework to public/users.

  5. jgebal commented on Oct 27, 2018

    @jgebal
    Member

    Quick fix was my initial thought too. It's not a clean solution though.

  6. self-assigned this
    on Oct 27, 2018
  7. lwasylow commented on Oct 27, 2018

    @lwasylow
    Member

    Will look onto that

  8. added 2 commits that reference this issue on Oct 27, 2018
  9. added this to the v3.1.3 milestone on Nov 2, 2018
  10. jgebal commented on Nov 17, 2018

    @jgebal
    Member

    Closing as it's fixed by #773

  11. reopened this on Nov 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions