Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 930efe1

Browse files
authored
Merge branch 'develop' into shortcuts
2 parents ec0bd42 + 5aa1e17 commit 930efe1

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

source/core/ut_annotations.pkb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,19 @@ create or replace package body ut_annotations as
337337

338338
function get_package_annotations(a_owner_name varchar2, a_name varchar2) return typ_annotated_package is
339339
l_source clob;
340+
ex_package_is_wrapped exception;
341+
pragma exception_init(ex_package_is_wrapped, -24241);
340342
begin
341343

342344
-- TODO: Add cache of annotations. Cache invalidation should be based on DDL timestamp.
343345
-- Cache garbage collection should be executed once in a while to remove annotations cache for packages that were dropped.
344-
345-
l_source := ut_metadata.get_package_spec_source(a_owner_name, a_name);
346+
347+
begin
348+
l_source := ut_metadata.get_package_spec_source(a_owner_name, a_name);
349+
exception
350+
when ex_package_is_wrapped then
351+
null;
352+
end;
346353

347354
if l_source is null or sys.dbms_lob.getlength(l_source)=0 then
348355
return null;

tests/RunAll.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ create table ut$test_table (val varchar2(1));
3131
exec ut_coverage.coverage_start_develop();
3232
@@lib/mystats/mystats start
3333

34+
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.IgnoreWrappedPackageAndDoesNotRaiseException.sql
3435
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationMixedWithWrongBeforeProcedure.sql
3536
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationNotBeforeProcedure.sql
3637
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParseComplexPackage.sql
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
begin
2+
DBMS_DDL.CREATE_WRAPPED(
3+
q'[
4+
CREATE OR REPLACE PACKAGE tst_wrapped_pck IS
5+
PROCEDURE dummy;
6+
END;
7+
]'
8+
);
9+
end;
10+
/
11+
12+
declare
13+
l_pck_annotation ut_annotations.typ_annotated_package;
14+
begin
15+
l_pck_annotation := ut_annotations.get_package_annotations(user, 'TST_WRAPPED_PCK');
16+
if l_pck_annotation.procedure_annotations.count = 0 and l_pck_annotation.package_annotations.count = 0 then
17+
:test_result := ut_utils.tr_success;
18+
end if;
19+
end;
20+
/
21+
22+
drop package tst_wrapped_pck;

0 commit comments

Comments
 (0)