diff --git a/doc/release_notes.md b/doc/release_notes.md index 75fac72..129ef7e 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -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 diff --git a/product/sert/post_install/01_recompile_schemas.sql b/product/sert/post_install/01_recompile_schemas.sql index 388e606..e249cae 100644 --- a/product/sert/post_install/01_recompile_schemas.sql +++ b/product/sert/post_install/01_recompile_schemas.sql @@ -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; / diff --git a/product/sert/post_install/setup_builder_menu_entries.sql b/product/sert/post_install/9000_setup_builder_menu_entries.sql similarity index 100% rename from product/sert/post_install/setup_builder_menu_entries.sql rename to product/sert/post_install/9000_setup_builder_menu_entries.sql diff --git a/product/sert/post_install/9001_check_invalids.sql b/product/sert/post_install/9001_check_invalids.sql.txt similarity index 78% rename from product/sert/post_install/9001_check_invalids.sql rename to product/sert/post_install/9001_check_invalids.sql.txt index 7cae6b4..0032b57 100644 --- a/product/sert/post_install/9001_check_invalids.sql +++ b/product/sert/post_install/9001_check_invalids.sql.txt @@ -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 @@ -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 diff --git a/product/sert/post_install/9001_check_invalids.xml b/product/sert/post_install/9001_check_invalids.xml new file mode 100644 index 0000000..9fb8a74 --- /dev/null +++ b/product/sert/post_install/9001_check_invalids.xml @@ -0,0 +1,51 @@ + + + + + + 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 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; + + + *** ERROR Invalid objects exist in schema *** + + diff --git a/product/sert/sert_core/package_body/data_api.pkb.sql b/product/sert/sert_core/package_body/data_api.pkb.sql index 21999c9..0d4cbb2 100644 --- a/product/sert/sert_core/package_body/data_api.pkb.sql +++ b/product/sert/sert_core/package_body/data_api.pkb.sql @@ -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 diff --git a/product/sert/sert_core/seed_data/055_prefs_internal_merge.sql b/product/sert/sert_core/seed_data/055_prefs_internal_merge.sql index 0f6577b..f9b6b49 100644 --- a/product/sert/sert_core/seed_data/055_prefs_internal_merge.sql +++ b/product/sert/sert_core/seed_data/055_prefs_internal_merge.sql @@ -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 diff --git a/product/sert/sert_core/seed_data/110_rule_import.sql b/product/sert/sert_core/seed_data/110_rule_import.sql index a6dcb0e..b872fdb 100644 --- a/product/sert/sert_core/seed_data/110_rule_import.sql +++ b/product/sert/sert_core/seed_data/110_rule_import.sql @@ -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, diff --git a/product/sert/sert_core/seed_data/110_rule_import_24_1.sql.txt b/product/sert/sert_core/seed_data/110_rule_import_24_1.sql.txt index d385bdb..29af0a0 100644 --- a/product/sert/sert_core/seed_data/110_rule_import_24_1.sql.txt +++ b/product/sert/sert_core/seed_data/110_rule_import_24_1.sql.txt @@ -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, diff --git a/product/sert/sert_core/table/eval_results_json_idx.txt b/product/sert/sert_core/table/eval_results_json_idx.txt new file mode 100644 index 0000000..8eca04e --- /dev/null +++ b/product/sert/sert_core/table/eval_results_json_idx.txt @@ -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; +*/ \ No newline at end of file