-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RAD-9 Add new validation to ensure no International Module content is…
… in the stand-alone package
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...entric/file-centric-snapshot-standalone-product-must-not-contain-international-module.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
/******************************************************************************** | ||
component-centric-snapshot-derivative-product-must-not-contain-international-module | ||
Assertion: | ||
Stand-alone products must not contain any International module ID | ||
********************************************************************************/ | ||
call validate_stand_alone_product_module_id('<PROSPECTIVE>',<RUNID>,'<ASSERTIONUUID>','<INTERNATIONAL_MODULES>'); |
28 changes: 28 additions & 0 deletions
28
scripts/resource/file-centric-stand-alone-product-moduleid-validation-proc.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/******************************************************************************** | ||
file-centric-stand-alone-product-moduleid-validation-proc.sql | ||
Assertion: | ||
Stand-alone products must not contain any INT module ID | ||
********************************************************************************/ | ||
drop procedure if exists validate_stand_alone_product_module_id; | ||
create procedure validate_stand_alone_product_module_id(dbname char(255),runid BIGINT, assertionid char(36), international_modules char(255)) | ||
begin | ||
declare no_more_rows integer default 0; | ||
declare tb_name char(255); | ||
declare table_cursor cursor for select table_name from information_schema.tables where table_schema = substring_index(dbname,'.',1) and table_name like '%\_s'; | ||
declare continue handler for not found set no_more_rows = 1; | ||
open table_cursor; | ||
myloop: loop fetch table_cursor into tb_name; | ||
if no_more_rows = 1 | ||
then close table_cursor; | ||
leave myloop; | ||
end if; | ||
set @component = substring_index(tb_name,'_s',1); | ||
set @details = CONCAT('CONCAT(\'',@component,'\',\' ::id= \',a.id,\' ::module id: \',a.moduleid,\' must not be in Internationl modules\')'); | ||
set @sql = CONCAT('insert into qa_result(run_id, assertion_id,concept_id, details) select ', runid,',',assertionid,',0,',@details,' from (select id,moduleid from ', substring_index(dbname,'.',1),'.',tb_name, ' where moduleid in (',international_modules,')) a;'); | ||
prepare stmt from @sql; | ||
execute stmt; | ||
drop prepare stmt; | ||
end loop myloop; | ||
end; |