[open-ils-commits] [GIT] Evergreen ILS branch master updated. f67b07b4e57dad132bd50f25d5abaa8f74bb0cdd

Evergreen Git git at git.evergreen-ils.org
Wed Dec 21 17:10:54 EST 2016


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, master has been updated
       via  f67b07b4e57dad132bd50f25d5abaa8f74bb0cdd (commit)
      from  510e9383617dabecc5ef7855e5f897c666c58a85 (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 f67b07b4e57dad132bd50f25d5abaa8f74bb0cdd
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Wed Dec 21 16:32:26 2016 -0500

    LP#1651808: avoid a class of intermittent search failures
    
    This patch fixes a bug where catalog searches can sometimes fail
    with a PostgreSQL error that looks like this:
    
    ERROR: type of parameter 56 (double precision) does not match that when preparing the plan (numeric)
    CONTEXT: PL/pgSQL function search.query_parser_fts(integer,integer,text,integer[],integer[],integer,integer,integer,boolean,boolean,boolean,integer) line 319 at assignment
    
    In particular, it ensures that the relevance values are coerced
    to the Pg NUMERIC data type regardless of how the core query is
    constructed; otherwise, it can sometimes end up as a double
    precision value.  Because of how Pg backends cache query plans,
    that change of type can result in the error above.
    
    To test
    -------
    [1] (Optional) Configure the max_children values for open-ils.storage
        to permit only one drone, which in turn forces all catalog
        search requests to go through a single Pg backend.
    [2] Set the default_preferred_language_weight opensrf.xml setting
        to 0.
    [3] Perform a catalog search that has just a filter, e.g.,
        item_lang(eng).
    [4] Perform a catalog search that includes search term, e.g.,
        cats
    [5] The second search should fail.
    [6] Apply the patch and try steps 3 and 4 again; this time, both
        searches should work.
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.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 4be8e93..4c386e5 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
@@ -980,7 +980,7 @@ sub toSQL {
 $with
 SELECT  $key AS id,
         $agg_records,
-        ${rel}::NUMERIC AS rel,
+        (${rel})::NUMERIC AS rel,
         $rank AS rank, 
         FIRST(pubdate_t.value) AS tie_break,
         STRING_AGG(ARRAY_TO_STRING(pop_with.badges,','),',') AS badges,

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

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


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list