[open-ils-commits] r8891 - trunk/Open-ILS/src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Mar 6 22:31:07 EST 2008
Author: miker
Date: 2008-03-06 21:58:33 -0500 (Thu, 06 Mar 2008)
New Revision: 8891
Modified:
trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql
Log:
improve metarecord constituent record test
Modified: trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql 2008-03-07 02:33:47 UTC (rev 8890)
+++ trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql 2008-03-07 02:58:33 UTC (rev 8891)
@@ -396,7 +396,12 @@
current_res.id = core_result.id;
current_res.rel = core_result.rel;
- IF array_upper(core_result.records, 1) = 1 THEN
+ tmp_int := 1;
+ IF metarecord THEN
+ SELECT COUNT(DISTINCT s.source) INTO tmp_int FROM metabib.metarecord_source_map s WHERE s.metarecord = core_result.id;
+ END IF;
+
+ IF tmp_int = 1 THEN
current_res.record = core_result.records[1];
ELSE
current_res.record = NULL;
@@ -458,7 +463,12 @@
current_res.id = core_result.id;
current_res.rel = core_result.rel;
- IF array_upper(core_result.records, 1) = 1 THEN
+ tmp_int := 1;
+ IF metarecord THEN
+ SELECT COUNT(DISTINCT s.source) INTO tmp_int FROM metabib.metarecord_source_map s WHERE s.metarecord = core_result.id;
+ END IF;
+
+ IF tmp_int = 1 THEN
current_res.record = core_result.records[1];
ELSE
current_res.record = NULL;
More information about the open-ils-commits
mailing list