From: Galen Charlton Date: Thu, 28 Feb 2013 19:05:25 +0000 (-0500) Subject: LP#1066326: protect against flags being entirely missing from config.internal_flag X-Git-Tag: sprint4-merge-nov22~3380 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bdcb51cde730810e706bdcf4b646f3db90fe4720;p=working%2FEvergreen.git LP#1066326: protect against flags being entirely missing from config.internal_flag Belt, meet suspenders. Signed-off-by: Galen Charlton Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/sql/Pg/030.schema.metabib.sql b/Open-ILS/src/sql/Pg/030.schema.metabib.sql index 317881b1d7..6d96938972 100644 --- a/Open-ILS/src/sql/Pg/030.schema.metabib.sql +++ b/Open-ILS/src/sql/Pg/030.schema.metabib.sql @@ -585,9 +585,9 @@ DECLARE b_skip_search BOOL; BEGIN - SELECT COALESCE(NULLIF(skip_facet, FALSE), enabled) INTO b_skip_facet FROM config.internal_flag WHERE name = 'ingest.skip_facet_indexing'; - SELECT COALESCE(NULLIF(skip_browse, FALSE), enabled) INTO b_skip_browse FROM config.internal_flag WHERE name = 'ingest.skip_browse_indexing'; - SELECT COALESCE(NULLIF(skip_search, FALSE), enabled) INTO b_skip_search FROM config.internal_flag WHERE name = 'ingest.skip_search_indexing'; + SELECT COALESCE(NULLIF(skip_facet, FALSE), EXISTS (SELECT enabled FROM config.internal_flag WHERE name = 'ingest.skip_facet_indexing' AND enabled)) INTO b_skip_facet; + SELECT COALESCE(NULLIF(skip_browse, FALSE), EXISTS (SELECT enabled FROM config.internal_flag WHERE name = 'ingest.skip_browse_indexing' AND enabled)) INTO b_skip_browse; + SELECT COALESCE(NULLIF(skip_search, FALSE), EXISTS (SELECT enabled FROM config.internal_flag WHERE name = 'ingest.skip_search_indexing' AND enabled)) INTO b_skip_search; PERFORM * FROM config.internal_flag WHERE name = 'ingest.assume_inserts_only' AND enabled; IF NOT FOUND THEN diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.partitioned-ingest.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.partitioned-ingest.sql index 22c9263383..b6d3b8ca10 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.partitioned-ingest.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.partitioned-ingest.sql @@ -17,9 +17,9 @@ DECLARE b_skip_search BOOL; BEGIN - SELECT COALESCE(NULLIF(skip_facet, FALSE), enabled) INTO b_skip_facet FROM config.internal_flag WHERE name = 'ingest.skip_facet_indexing'; - SELECT COALESCE(NULLIF(skip_browse, FALSE), enabled) INTO b_skip_browse FROM config.internal_flag WHERE name = 'ingest.skip_browse_indexing'; - SELECT COALESCE(NULLIF(skip_search, FALSE), enabled) INTO b_skip_search FROM config.internal_flag WHERE name = 'ingest.skip_search_indexing'; + SELECT COALESCE(NULLIF(skip_facet, FALSE), EXISTS (SELECT enabled FROM config.internal_flag WHERE name = 'ingest.skip_facet_indexing' AND enabled)) INTO b_skip_facet; + SELECT COALESCE(NULLIF(skip_browse, FALSE), EXISTS (SELECT enabled FROM config.internal_flag WHERE name = 'ingest.skip_browse_indexing' AND enabled)) INTO b_skip_browse; + SELECT COALESCE(NULLIF(skip_search, FALSE), EXISTS (SELECT enabled FROM config.internal_flag WHERE name = 'ingest.skip_search_indexing' AND enabled)) INTO b_skip_search; PERFORM * FROM config.internal_flag WHERE name = 'ingest.assume_inserts_only' AND enabled; IF NOT FOUND THEN