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

Skip to content

Commit 87bf121

Browse files
committed
fixed the issue when regex_substr leaded to freeze (seems like a DB bug)
1 parent 42d5b46 commit 87bf121

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

source/core/annotations/ut_annotations.pkb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ create or replace package body ut_annotations as
134134
l_package_comments varchar2(32767);
135135
begin
136136
l_package_comments := regexp_substr(srcstr => a_source
137-
,pattern => '^\s*(CREATE\s+(OR\s+REPLACE)?(\s+(NON)?EDITIONABLE)?\s+)?PACKAGE(.|\s)*?(\s+(AS|IS)\s+)((.*?{COMMENT#\d+}\s?)+)'
137+
,pattern => '^\s*(CREATE\s+(OR\s+REPLACE)?(\s+(NON)?EDITIONABLE)?\s+)?PACKAGE\s[^;]*?(\s+(AS|IS)\s+)((.*?{COMMENT#\d+}\s?)+)'
138138
,modifier => 'i'
139-
,subexpression => 8);
139+
,subexpression => 7);
140140

141141
-- parsing for package annotations
142142
return
@@ -328,7 +328,7 @@ create or replace package body ut_annotations as
328328

329329
l_source := ut_metadata.get_package_spec_source(a_owner_name, a_name);
330330

331-
if l_source is null then
331+
if l_source is null or sys.dbms_lob.getlength(l_source)=0 then
332332
return null;
333333
else
334334
return parse_package_annotations(l_source);

0 commit comments

Comments
 (0)