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

Skip to content

Commit 0d64c08

Browse files
committed
Changed syntax to avoid Oracle internal errors on 11.2 and 12.1
1 parent cdb6d3e commit 0d64c08

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

source/core/ut_suite_cache_manager.pkb

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,21 +132,12 @@ create or replace package body ut_suite_cache_manager is
132132
q'[included_tags as (
133133
select c.obj.path as path
134134
from suite_items c
135-
where exists (
136-
select * from table(c.obj.tags)
137-
intersect
138-
select * from table(:a_tag_list) where column_value not like '-%'
139-
)
140-
or 0 = (select count(*) from table(:a_tag_list) where column_value not like '-%')
135+
where c.obj.tags multiset intersect :a_include_tag_list is not empty or :a_include_tag_list is empty
141136
),
142137
excluded_tags as (
143138
select c.obj.path as path
144139
from suite_items c
145-
where exists (
146-
select * from table(c.obj.tags)
147-
intersect
148-
select ltrim(column_value,'-') from table(:a_tag_list) where column_value like '-%'
149-
)
140+
where c.obj.tags multiset intersect :a_exclude_tag_list is not empty
150141
),
151142
suite_items_tags as (
152143
select c.*
@@ -162,7 +153,7 @@ create or replace package body ut_suite_cache_manager is
162153
)
163154
),]'
164155
else
165-
q'[dummy as (select 'x' from dual where :a_tag_list is null and :a_tag_list is null and :a_tag_list is null),]'
156+
q'[dummy as (select 'x' from dual where :a_include_tag_list is null and :a_include_tag_list is null and :a_exclude_tag_list is null),]'
166157
end;
167158
end;
168159

@@ -205,10 +196,23 @@ create or replace package body ut_suite_cache_manager is
205196
l_sql varchar2(32767);
206197
l_suite_item_name varchar2(20);
207198
l_tags ut_varchar2_rows := coalesce(a_tags,ut_varchar2_rows());
199+
l_include_tags ut_varchar2_rows;
200+
l_exclude_tags ut_varchar2_rows;
208201
l_object_owner varchar2(250) := ut_utils.qualified_sql_name(a_object_owner);
209202
l_object_name varchar2(250) := ut_utils.qualified_sql_name(a_object_name);
210203
l_procedure_name varchar2(250) := ut_utils.qualified_sql_name(a_procedure_name);
211204
begin
205+
206+
select column_value
207+
bulk collect into l_include_tags
208+
from table(l_tags)
209+
where column_value not like '-%';
210+
211+
select ltrim(column_value,'-')
212+
bulk collect into l_exclude_tags
213+
from table(l_tags)
214+
where column_value like '-%';
215+
212216
if a_path is null and a_object_name is not null then
213217
select min(c.path)
214218
into l_path
@@ -234,7 +238,7 @@ create or replace package body ut_suite_cache_manager is
234238

235239
execute immediate l_sql
236240
bulk collect into l_results
237-
using upper(l_object_owner), l_path, l_path, upper(a_object_name), upper(a_procedure_name), l_tags, l_tags, l_tags, a_random_seed;
241+
using upper(l_object_owner), l_path, l_path, upper(a_object_name), upper(a_procedure_name), l_include_tags, l_include_tags, l_exclude_tags, a_random_seed;
238242
return l_results;
239243
end;
240244

0 commit comments

Comments
 (0)