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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e41d6f9
Interim commit with lots of dirty code - got to a place where I get t…
jgebal Oct 30, 2018
f475b7c
Added `suite_cache`.
jgebal Nov 2, 2018
4dc48e6
Interim commit - performance check on Travis.
jgebal Nov 4, 2018
1611e09
Interim commit some fixes to old tests, examples and code itself.
jgebal Nov 4, 2018
15163a8
Resolved issue with sorting of nested-tables.
jgebal Nov 4, 2018
1b14bb5
Fixing re-enabled test.
jgebal Nov 4, 2018
3bc8da5
Adding missing items to uninstall.
jgebal Nov 4, 2018
8911f97
Small improvements and cleanup.
jgebal Nov 5, 2018
a1f6b34
Removing duplicate with block.
jgebal Nov 6, 2018
59f7738
Adding cache cleanup and "intelligent" join to all_source, only when …
jgebal Nov 11, 2018
cb9cf97
Resolving some sonar violations.
jgebal Nov 11, 2018
8779025
Moving away from full outer join.
jgebal Nov 11, 2018
b3e98be
Reorganizing code a bit.
jgebal Nov 11, 2018
64dfb41
Output buffer&reporters performance improvements
jgebal Nov 12, 2018
9ea805b
Increased fetch size for coverage sources tmp seeding.
jgebal Nov 12, 2018
248bf8c
Small refactoring.
jgebal Nov 13, 2018
8fc2ea6
Further optimizations to suite parsing.
jgebal Nov 15, 2018
3543e3d
Disabled `PLSQL_OPTIMIZE_LEVEL=0` for testing
jgebal Nov 15, 2018
23c0557
Fixed formal parameter names
jgebal Nov 15, 2018
f7f6811
Revert "Disabled `PLSQL_OPTIMIZE_LEVEL=0` for testing"
jgebal Nov 15, 2018
d002d18
Refactored procedure `get_unit_test_info` to return more relevant inf…
jgebal Nov 16, 2018
e1f1eec
Renamed `get_unit_test_info` to `get_suites_info` - the latter one wa…
jgebal Nov 16, 2018
d8d251f
Improved automation of `refresh_sources.sh`
jgebal Nov 16, 2018
eb3df21
Fixing failing test.
jgebal Nov 16, 2018
d211348
Added control over rollback behavior in `ut_runner.run`
jgebal Nov 17, 2018
f342195
Reverting rollback changes - they should go as a separate PR.
jgebal Nov 17, 2018
eeae79b
Added documentation for new functionality.
jgebal Nov 17, 2018
74ec9a1
Removed unused code.
jgebal Nov 18, 2018
44d61d9
Recovering exception handlers as they are needed for handling invalid…
jgebal Nov 18, 2018
360a889
Moved some of old tests into new tests.
jgebal Nov 18, 2018
0ee3ce2
Added missing endcontext in `test_ut_test`
jgebal Nov 18, 2018
48aa338
Removed unused constants.
jgebal Nov 18, 2018
b33aaae
Added additional test for display of parser warnings.
jgebal Nov 18, 2018
e8ea644
Merge branch 'develop' into feature/suite_query_api
jgebal Nov 18, 2018
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
Next Next commit
Moving away from full outer join.
Added static schema name rather than bind variable.
  • Loading branch information
jgebal committed Nov 11, 2018
commit 8779025d8ff01fc03a935e16e9199978d8877d52
112 changes: 48 additions & 64 deletions source/core/annotations/ut_annotation_manager.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,37 @@ create or replace package body ut_annotation_manager as
------------------------------
--private definitions

-- function get_missing_objects(a_object_owner varchar2, a_object_type varchar2) return ut_annotation_objs_cache_info is
-- l_rows sys_refcursor;
-- l_ut_owner varchar2(250) := ut_utils.ut_owner;
-- l_objects_view varchar2(200) := ut_metadata.get_dba_view('dba_objects');
-- l_cursor_text varchar2(32767);
-- l_result ut_annotation_objs_cache_info;
-- begin
-- l_cursor_text :=
-- q'[select ]'||l_ut_owner||q'[.ut_annotation_obj_cache_info(
-- object_owner => i.object_owner,
-- object_name => i.object_name,
-- object_type => i.object_type,
-- needs_refresh => null
-- )
-- from ]'||l_ut_owner||q'[.ut_annotation_cache_info i
-- where
-- not exists (
-- select 1 from ]'||l_objects_view||q'[ o
-- where o.owner = i.object_owner
-- and o.object_name = i.object_name
-- and o.object_type = i.object_type
-- and o.owner = :a_object_owner
-- and o.object_type = :a_object_type
-- )
-- and i.object_owner = :a_object_owner
-- and i.object_type = :a_object_type]';
-- open l_rows for l_cursor_text using a_object_owner, a_object_type, a_object_owner, a_object_type;
-- fetch l_rows bulk collect into l_result limit 1000000;
-- close l_rows;
-- return l_result;
-- end;
function get_missing_objects(a_object_owner varchar2, a_object_type varchar2) return ut_annotation_objs_cache_info is
l_rows sys_refcursor;
l_ut_owner varchar2(250) := ut_utils.ut_owner;
l_objects_view varchar2(200) := ut_metadata.get_dba_view('dba_objects');
l_cursor_text varchar2(32767);
l_result ut_annotation_objs_cache_info;
begin
l_cursor_text :=
q'[select ]'||l_ut_owner||q'[.ut_annotation_obj_cache_info(
object_owner => i.object_owner,
object_name => i.object_name,
object_type => i.object_type,
needs_refresh => null
)
from ]'||l_ut_owner||q'[.ut_annotation_cache_info i
where
not exists (
select 1 from ]'||l_objects_view||q'[ o
where o.owner = i.object_owner
and o.object_name = i.object_name
and o.object_type = i.object_type
and o.owner = :a_object_owner
and o.object_type = :a_object_type
)
and i.object_owner = :a_object_owner
and i.object_type = :a_object_type]';
open l_rows for l_cursor_text using a_object_owner, a_object_type, a_object_owner, a_object_type;
fetch l_rows bulk collect into l_result limit 1000000;
close l_rows;
return l_result;
end;

function get_annotation_objs_info(a_object_owner varchar2, a_object_type varchar2, a_parse_date timestamp := null) return ut_annotation_objs_cache_info is
l_rows sys_refcursor;
Expand All @@ -60,36 +60,25 @@ create or replace package body ut_annotation_manager as
begin
l_cursor_text :=
q'[select ]'||l_ut_owner||q'[.ut_annotation_obj_cache_info(
object_owner => nvl( o.owner, i.object_owner ),
object_name => nvl( o.object_name, i.object_name ),
object_type => nvl( o.object_type, i.object_type ),
needs_refresh =>
case
when o.last_ddl_time < cast(i.parse_time as date) then 'N'
when o.owner is null then null
else 'Y'
end
object_owner => o.owner,
object_name => o.object_name,
object_type => o.object_type,
needs_refresh => case when o.last_ddl_time < cast(i.parse_time as date) then 'N' else 'Y' end
)
from (
select * from ]'||l_objects_view||q'[ o
where o.owner = :a_object_owner
and o.object_type = :a_object_type
) o
full outer join (
select * from ]'||l_ut_owner||q'[.ut_annotation_cache_info i
where i.object_owner = :a_object_owner
and i.object_type = :a_object_type
) i
from ]'||l_objects_view||q'[ o
left join ]'||l_ut_owner||q'[.ut_annotation_cache_info i
on o.owner = i.object_owner
and o.object_name = i.object_name
and o.object_type = i.object_type
where ]'
|| case
where o.owner = ']'||a_object_owner||q'['
and o.object_type = ']'||a_object_type||q'['
and ]'
|| case
when a_parse_date is null
then ':a_parse_date is null'
else 'o.last_ddl_time >= cast(:a_parse_date as date) or o.last_ddl_time is null'
end;
open l_rows for l_cursor_text using a_object_owner, a_object_type, a_object_owner, a_object_type, a_parse_date;
then ':a_parse_date is null'
else 'o.last_ddl_time >= cast(:a_parse_date as date)'
end;
open l_rows for l_cursor_text using a_parse_date;
fetch l_rows bulk collect into l_result limit 1000000;
close l_rows;
return l_result;
Expand Down Expand Up @@ -197,7 +186,6 @@ create or replace package body ut_annotation_manager as
a_info_rows ut_annotation_objs_cache_info
) is
l_objects_to_parse ut_annotation_objs_cache_info;
l_objects_to_remove ut_annotation_objs_cache_info;
begin
select value(x)bulk collect into l_objects_to_parse
from table(a_info_rows) x where x.needs_refresh = 'Y';
Expand All @@ -208,13 +196,9 @@ create or replace package body ut_annotation_manager as
or ut_metadata.is_object_visible('ut3.ut_utils')
or ut_metadata.is_object_visible('dba_objects')
then
select value(x)bulk collect into l_objects_to_remove
from table(a_info_rows) x where x.needs_refresh is null;

ut_annotation_cache_manager.remove_from_cache(l_objects_to_remove);
-- ut_annotation_cache_manager.remove_from_cache(
-- get_missing_objects(a_object_owner, a_object_type)
-- );
ut_annotation_cache_manager.remove_from_cache(
get_missing_objects(a_object_owner, a_object_type)
);
end if;

--if some source needs parsing and putting into cache
Expand Down
13 changes: 7 additions & 6 deletions source/core/ut_suite_builder.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -1020,10 +1020,10 @@ create or replace package body ut_suite_builder is
where o.owner = i.object_owner
and o.object_name = i.object_name
and o.object_type = 'PACKAGE'
and o.owner = :a_object_owner
and o.owner = ']'||a_object_owner||q'['
)
and i.object_owner = :a_object_owner]';
open l_rows for l_cursor_text using a_object_owner, a_object_owner;
and i.object_owner = ']'||a_object_owner||q'[']';
open l_rows for l_cursor_text;
fetch l_rows bulk collect into l_result limit 1000000;
close l_rows;
return l_result;
Expand Down Expand Up @@ -1061,10 +1061,11 @@ create or replace package body ut_suite_builder is
( select 1
from all_objects a
where a.object_name = c.object_name
and a.object_owner = ']'||upper(a_object_owner)||q'['
and a.owner = c.object_owner
and a.object_type = 'PACKAGE'
)]' end ||q'[
and c.object_owner = :a_object_owner
and c.object_owner = ']'||upper(a_object_owner)||q'['
and ( ]' || case when l_path is not null then q'[
:l_path||'.' like c.path || '.%' /*all children and self*/
or ( c.path||'.' like :l_path || '.%' --all parents
Expand Down Expand Up @@ -1134,7 +1135,7 @@ create or replace package body ut_suite_builder is
end, '.', chr(0)) desc nulls last,
c.object_name desc,
c.line_no]'
using upper(a_object_owner), l_path, l_path, upper(a_object_name), upper(a_procedure_name);
using l_path, l_path, upper(a_object_name), upper(a_procedure_name);

return l_result;
end;
Expand Down Expand Up @@ -1238,7 +1239,7 @@ create or replace package body ut_suite_builder is
then
l_need_all_objects_scan := false;
end if;

execute immediate 'select c.object_owner, c.object_name
from '||l_ut_owner||q'[.ut_suite_cache_package c
join table ( :a_schema_names ) s
Expand Down