Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Removed unneeded is_annotated column
  • Loading branch information
jgebal committed Feb 22, 2020
commit 5d4c33c8c74bcf2479e16a961a2b39f7e430b04f
2 changes: 0 additions & 2 deletions source/core/annotations/ut_annotation_cache_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ create table ut_annotation_cache_info (
object_name varchar2(250) not null,
object_type varchar2(250) not null,
parse_time timestamp not null,
is_annotated varchar2(1) not null,
constraint ut_annotation_cache_info_ck1 check(is_annotated in ('Y','N')),
constraint ut_annotation_cache_info_pk primary key(cache_id) using index,
constraint ut_annotation_cache_info_uk unique (object_owner, object_type, object_name) using index,
constraint ut_annotation_cache_info_fk foreign key(object_owner, object_type) references ut_annotation_cache_schema(object_owner, object_type) on delete cascade
Expand Down
16 changes: 6 additions & 10 deletions source/core/annotations/ut_annotation_cache_manager.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,16 @@ create or replace package body ut_annotation_cache_manager as
if ora_sysevent is null or a_object.annotations is not null and a_object.annotations.count > 0 then

update ut_annotation_cache_info i
set i.parse_time = l_timestamp,
i.is_annotated = case when a_object.annotations is not empty then 'Y' else 'N' end
set i.parse_time = l_timestamp
where (i.object_owner, i.object_name, i.object_type)
in ((a_object.object_owner, a_object.object_name, a_object.object_type))
returning cache_id into l_cache_id;

if sql%rowcount = 0 then

insert into ut_annotation_cache_info
(cache_id, object_owner, object_name, object_type, parse_time, is_annotated)
values (ut_annotation_cache_seq.nextval, a_object.object_owner, a_object.object_name, a_object.object_type, l_timestamp,
case when a_object.annotations is not empty then 'Y' else 'N' end
)
(cache_id, object_owner, object_name, object_type, parse_time)
values (ut_annotation_cache_seq.nextval, a_object.object_owner, a_object.object_name, a_object.object_type, l_timestamp)
returning cache_id into l_cache_id;
end if;

Expand Down Expand Up @@ -108,11 +105,10 @@ create or replace package body ut_annotation_cache_manager as
and o.object_owner = i.object_owner)
when matched then
update
set parse_time = l_timestamp,
is_annotated = 'N'
set parse_time = l_timestamp
when not matched then insert
(cache_id, object_owner, object_name, object_type, parse_time, is_annotated)
values (ut_annotation_cache_seq.nextval, o.object_owner, o.object_name, o.object_type, l_timestamp, 'N');
(cache_id, object_owner, object_name, object_type, parse_time)
values (ut_annotation_cache_seq.nextval, o.object_owner, o.object_name, o.object_type, l_timestamp);

commit;
end;
Expand Down
2 changes: 1 addition & 1 deletion test/ut3_tester/core/annotations/test_annotation_cache.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ create or replace package body test_annotation_cache is
from ut3.ut_annotation_cache_info
where object_owner = 'UT3_CACHE_TEST_OWNER';
open l_expected_cache_info for
select 'UT3_CACHE_TEST_OWNER' as object_owner, upper( column_value ) as object_name, 'Y' as is_annotated
select 'UT3_CACHE_TEST_OWNER' as object_owner, upper( column_value ) as object_name
from table (a_packages) x;
ut.expect( l_actual_cache_info ).to_equal( l_expected_cache_info ).exclude( 'CACHE_ID,PARSE_TIME,OBJECT_TYPE' ).JOIN_BY('OBJECT_NAME');
end;
Expand Down