Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions doc/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Release Notes

## 24.2.17

* [GAT-466] - Rule "List Entry Does Not Contain &ITEM. Syntax" - wrong component_id #42
* [GAT-467] - product/sert/post_install/9001_check_invalids.sql throws error when using sqlcl24.1
* [GAT-468] - DB 19.2x Error on installing product/sert/post_install/9001_check_invalids.sql SERT_CORE.EXCEPTIONS_API #40

## 24.2.16

* [GAT-465] - EVAL_RESULTS_EXC_PUB_V will not compile with ANSI join on PDB 19.27 #38
Expand Down
31 changes: 31 additions & 0 deletions product/sert/post_install/01_recompile_schemas.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,39 @@
--------------------------------------------------------------------------------
--changeset mipotter:compile_schemas stripComments:false runOnChange:true runAlways:true endDelimiter:/ rollbackEndDelimiter:/

declare
v_sql varchar2(1024);
begin
sys.dbms_utility.compile_schema(schema => 'SERT_CORE', compile_all => false);
sys.dbms_utility.compile_schema(schema => 'SERT_PUB', compile_all => false);

-- in 19.28 ADB and 19.27 PDB we are seeing one package (exceptions_api)
-- remain invalid, direct compilation then succeeds. this is a generic
-- workaround to attempt a explicit compile

-- Loop through all invalid packages and package bodies in the SERT_CORE schema
for cur_rec in (
-- Query dba_objects to find invalid packages and package bodies
select object_name, object_type
from dba_objects
where owner = 'SERT_CORE'
and status = 'INVALID'
and object_type in ('PACKAGE', 'PACKAGE BODY')
) loop
if cur_rec.object_type = 'PACKAGE' then
v_sql := 'alter package SERT_CORE.' || cur_rec.object_name || ' compile';
else
v_sql := 'alter package SERT_CORE.' || cur_rec.object_name || ' compile body';
end if;

-- Attempt to recompile the object
begin
execute immediate v_sql;
exception
-- Catch any exceptions that occur during recompilation
when others then
raise;
end;
end loop;
end;
/
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
-- Licensed under the Universal Permissive License v 1.0 as shown
-- at https://oss.oracle.com/licenses/upl/
--------------------------------------------------------------------------------
--changeset mipotter:9001_check_invalids_1750135149958 endDelimiter:; runOnChange:true runAlways:true rollbackEndDelimiter:; stripComments:false
--
-- This script will only work for SQLCL 25+
-- SQLCL 24.2 and lower will raise liquibase errors due to set command and raise command
--
--------------------------------------------------------------------------------

--changeset mipotter:9001_check_invalids_xml endDelimiter:; runOnChange:true runAlways:true rollbackEndDelimiter:; stripComments:false
--preconditions onFail:MARK_RAN onError:HALT
--precondition-sql-check expectedResult:1 select case when count(status) > 0 then 1 else 0 end as mycount from dba_objects where owner in ('SERT_CORE','SERT_PUB') and status = 'INVALID';
set serveroutput on
Expand Down Expand Up @@ -35,6 +41,6 @@ where owner in ('SERT_CORE','SERT_PUB')
order by owner, type, name, sequence;

-- now raise an error!
exec RAISE_APPLICATION_ERROR (-20001, 'Errors found after compiling SERT schemas!');
exec RAISE_APPLICATION_ERROR (-20001, '**** Errors found after compiling SERT schemas!');

--rollback not required
51 changes: 51 additions & 0 deletions product/sert/post_install/9001_check_invalids.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ora="http://www.oracle.com/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"
>
<changeSet
id="invalid_objects_check"
author="jlyle"
runOnChange="true"
runAlways="true"
>
<preConditions onFail="MARK_RAN" onError="HALT">
<sqlCheck expectedResult="1">
select case when count(status) > 0 then 1 else 0 end as mycount from dba_objects where owner in ('SERT_CORE','SERT_PUB') and status = 'INVALID';
</sqlCheck>
</preConditions>
<rollback></rollback>
<ora:runOracleScript ownerName="jlyle" sourceType="STRING" objectType="SCRIPT" objectName="invalid_objects_check">
<ora:source>
set pagesize 50000
prompt "********************************************************************************"
prompt "** Invalid Objects"
prompt "********************************************************************************"
select /*ansiconsole*/
owner||'.'||object_name invalid_object
,object_type
from dba_objects
where status = 'INVALID'
and owner in ('SERT_CORE','SERT_PUB');

prompt "********************************************************************************"
prompt "** Object Errors"
prompt "********************************************************************************"
select /*ansiconsole*/
owner||'.'||name invalid_object
,type
,sequence
,line
,position
,nvl(regexp_substr(regexp_replace(text, '^PL/SQL: '), '^(ORA|PLS|PLW)'), 'PLS') message_type
,regexp_replace(regexp_replace(text, '^PL/SQL: '), '(ORA|PLS|PLW)-[0-9]+: ') text
from dba_errors
where owner in ('SERT_CORE','SERT_PUB')
order by owner, type, name, sequence;
</ora:source>
</ora:runOracleScript>
<stop>*** ERROR Invalid objects exist in schema ***</stop>
</changeSet>
</databaseChangeLog>
5 changes: 5 additions & 0 deletions product/sert/sert_core/package_body/data_api.pkb.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
--liquibase formatted sql
-------------------------------------------------------------------------------
-- Copyright (c) 2024,2025 Oracle and/or its affiliates.
-- Licensed under the Universal Permissive License v 1.0 as shown
-- at https://oss.oracle.com/licenses/upl/
--------------------------------------------------------------------------------
--changeset mlancast:data_api_create_body stripComments:false endDelimiter:/ runOnChange:true
create or replace package body sert_core.data_api as

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ begin
merge into sert_core.prefs dst
using ( select 'Release Version' as pref_name
, 'RELEASE_VERSION' as pref_key
, '24.2.16' as pref_value
, '24.2.17' as pref_value
, 'Y' as internal_yn from dual ) src
on ( src.pref_key = dst.pref_key)
when matched then
Expand Down
4 changes: 2 additions & 2 deletions product/sert/sert_core/seed_data/110_rule_import.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5615,10 +5615,10 @@ begin
p_view_name => 'APEX_APPLICATION_LIST_ENTRIES',
p_column_to_evaluate => 'ENTRY_TEXT',
p_component_id => 'LIST_ID',
p_component_name => 'ENTRY_TEXT',
p_component_name => 'LIST_NAME:ENTRY_TEXT',
p_column_name => '',
p_item_name => '',
p_shared_comp_name => 'LIST_NAME',
p_shared_comp_name => 'LIST_ENTRY_ID',
p_operand => 'CRITERIA',
p_val_char => '',
p_val_number => null,
Expand Down
4 changes: 2 additions & 2 deletions product/sert/sert_core/seed_data/110_rule_import_24_1.sql.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5617,10 +5617,10 @@ begin
p_view_name => 'APEX_APPLICATION_LIST_ENTRIES',
p_column_to_evaluate => 'ENTRY_TEXT',
p_component_id => 'LIST_ID',
p_component_name => 'ENTRY_TEXT',
p_component_name => 'LIST_NAME:ENTRY_TEXT',
p_column_name => '',
p_item_name => '',
p_shared_comp_name => 'LIST_NAME',
p_shared_comp_name => 'LIST_ENTRY_ID',
p_operand => 'CRITERIA',
p_val_char => '',
p_val_number => null,
Expand Down
13 changes: 13 additions & 0 deletions product/sert/sert_core/table/eval_results_json_idx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
--changeset mipotter:alter_table_sert_core.eval_results_add_constraint_result_is_json endDelimiter:; runOnChange:true runAlways:false rollbackEndDelimiter:; stripComments:false
--preconditions onFail:MARK_RAN onError:HALT
--precondition-sql-check expectedResult:0 select count(1) from dba_constraints where owner = 'SERT_CORE' and constraint_name = 'RESULT_IS_JSON'
ALTER TABLE sert_core.eval_results ADD CONSTRAINT result_is_json CHECK (result IS JSON) ENABLE novalidate;
--rollback alter table sert_core.eval_results drop constraint RESULT_IS_JSON;

--changeset mipotter:create_index_sert_core.eval_results_result_jidx_1752059964456 endDelimiter:; runOnChange:true runAlways:false rollbackEndDelimiter:; stripComments:false
--preconditions onFail:MARK_RAN onError:HALT
--precondition-sql-check expectedResult:0 select count(1) from dba_indexes where owner = 'SERT_CORE' and table_name = 'EVAL_RESULTS' and index_name = 'EVAL_RESULTS_RESULT_JIDX';
create search index sert_core.eval_results_result_jidx on sert_core.eval_results(result) for json;
--rollback drop INDEX sert_core.eval_results_result_jidx;
*/