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

Skip to content

Commit 9010fcb

Browse files
committed
Fixing gaps in uninstall process.
1 parent 7b71d02 commit 9010fcb

3 files changed

Lines changed: 32 additions & 14 deletions

File tree

.github/scripts/uninstall_validate_utplsql.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@ time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
1515
set feedback off
1616
set verify off
1717
whenever sqlerror exit failure rollback
18+
set serverout on
19+
begin
20+
for i in (
21+
select o.object_type||' '||o.owner||'.'||o.object_name as obj
22+
from dba_objects o
23+
where owner = '$UT3_DEVELOP_SCHEMA'
24+
union all
25+
select 'SYNONYM '||s.owner||'.'||s.synonym_name||' FOR '||s.table_owner||'.'||s.table_name as obj
26+
from dba_synonyms s
27+
where table_owner = '$UT3_DEVELOP_SCHEMA'
28+
) loop
29+
dbms_output.put_line(i.obj);
30+
end loop;
31+
end;
32+
/
1833
declare
1934
v_leftover_objects_count integer;
2035
begin
@@ -34,5 +49,5 @@ time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
3449
end if;
3550
end;
3651
/
37-
drop user $UT3_DEVELOP_SCHEMA cascade;
52+
drop user $UT3_DEVELOP_SCHEMA;
3853
SQL

source/expectations/json_objects_specs.sql

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
BEGIN
2-
3-
$if dbms_db_version.version >= 21 $then
4-
dbms_output.put_line('Object exists , dont install');
5-
$elsif dbms_db_version.version = 12 and dbms_db_version.release >= 2 or ( dbms_db_version.version > 12 and dbms_db_version.version < 21 ) $then
6-
dbms_output.put_line('Installing json structures specs for native json.');
7-
execute immediate q'[create or replace TYPE JSON FORCE AUTHID CURRENT_USER AS OBJECT(
8-
dummyobjt NUMBER
9-
) NOT FINAL NOT INSTANTIABLE;]';
10-
$else
2+
null;
3+
$if dbms_db_version.version < 21 $then
114
dbms_output.put_line('Installing json structures specs for native json.');
125
execute immediate q'[create or replace TYPE JSON FORCE AUTHID CURRENT_USER AS OBJECT(
136
dummyobjt NUMBER
147
) NOT FINAL NOT INSTANTIABLE;]';
15-
8+
$end
9+
$if dbms_db_version.version = 12 and dbms_db_version.release = 1 or dbms_db_version.version < 12 $then
1610
dbms_output.put_line('Installing json structures specs.');
1711
execute immediate q'[create or replace TYPE JSON_Element_T FORCE AUTHID CURRENT_USER AS OBJECT(
1812
dummyobjt NUMBER,

source/uninstall_objects.sql

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ drop type ut_comparison_matcher force;
156156

157157
drop type ut_matcher force;
158158

159+
drop type ut_expectation_base force;
160+
161+
drop type ut_matcher_base force;
162+
159163
drop type ut_data_value_yminterval force;
160164

161165
drop type ut_data_value_varchar2 force;
@@ -245,10 +249,15 @@ drop package ut_metadata;
245249
drop package ut_ansiconsole_helper;
246250

247251
begin
252+
null;
253+
$if dbms_db_version.version < 21 $then
254+
begin execute immediate 'drop type json force'; exception when others then null; end;
255+
$end
248256
$if dbms_db_version.version = 12 and dbms_db_version.release = 1 or dbms_db_version.version < 12 $then
249-
execute immediate 'drop type json_element_t force';
250-
$else
251-
dbms_output.put_line('Nothing to drop');
257+
begin execute immediate 'drop type json_element_t force'; exception when others then null; end;
258+
begin execute immediate 'drop type json_object_t force'; exception when others then null; end;
259+
begin execute immediate 'drop type json_array_t force'; exception when others then null; end;
260+
begin execute immediate 'drop type json_key_list force'; exception when others then null; end;
252261
$end
253262
end;
254263
/

0 commit comments

Comments
 (0)