[open-ils-commits] [GIT] Evergreen ILS branch rel_3_1 updated. a51393b20defc3cf573c52ddf9bba412ff1ed052

Evergreen Git git at git.evergreen-ils.org
Wed Jun 27 19:13:39 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_1 has been updated
       via  a51393b20defc3cf573c52ddf9bba412ff1ed052 (commit)
      from  0f3aa6168659f03d0995cdcafe60389ba99b5093 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a51393b20defc3cf573c52ddf9bba412ff1ed052
Author: Mike Rylander <mrylander at gmail.com>
Date:   Wed Jun 20 09:22:38 2018 -0400

    LP#1773832: Empty deleted records can be surfaced in search results
    
    There are cases where we avoid checking the deleted flag of bibs as an
    optimization that avoids a JOIN in the search query.  However, for some
    shapes of real-world data, particularly in upgraded instances, deleted
    records can slip through.  This commit adds an explicit check for the
    flag to all search queries.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Daniel Pearl <dpearl at cwmars.org>
    Signed-off-by: Jason Stephenson <jason at sigio.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
index 981bff9..6141d66 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
@@ -883,8 +883,8 @@ sub toSQL {
         $bre_join = 'INNER JOIN biblio.record_entry bre ON m.source = bre.id AND bre.deleted';
         # The above suffices for filters too when the #deleted modifier
         # is in use.
-    } elsif ($$flat_plan{uses_bre} or !$self->find_modifier('staff')) {
-        $bre_join = 'INNER JOIN biblio.record_entry bre ON m.source = bre.id';
+    } else {
+        $bre_join = 'INNER JOIN biblio.record_entry bre ON m.source = bre.id AND NOT bre.deleted';
     }
 
     my $desc = 'ASC';
@@ -1064,7 +1064,7 @@ sub toSQL {
                 "AND (bre.vis_attr_vector IS NULL OR NOT ( int4range(0,268435455,'[]') @> ANY(bre.vis_attr_vector) ))".
             "))";
         # We need bre here, regardless
-        $bre_join ||= 'INNER JOIN biblio.record_entry bre ON m.source = bre.id';
+        $bre_join ||= 'INNER JOIN biblio.record_entry bre ON m.source = bre.id AND NOT bre.deleted';
     }
 
     my $final_b_attr_test;

-----------------------------------------------------------------------

Summary of changes:
 .../Application/Storage/Driver/Pg/QueryParser.pm   |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list