From: Thomas Berezansky Date: Sun, 17 Feb 2013 00:03:27 +0000 (-0500) Subject: QueryParser: Provide null rank query as default X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3a7baccb538efdf1ba6d5d7a13278a2716f5597b;p=contrib%2FConifer.git QueryParser: Provide null rank query as default If a given node contains only negative atoms the rank query was coming out as an empty string, which was generating bad SQL. This causes the default to be a null tsquery instead. Signed-off-by: Thomas Berezansky Signed-off-by: Ben Shum --- 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 8914bd1605..6e80ba45e5 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 @@ -1559,6 +1559,7 @@ sub tsquery_rank { push @atomlines, "\n" . ${spc} x 3 . $atom->sql; } $self->{tsquery_rank} = join(' ||', @atomlines); + $self->{tsquery_rank} = 'NULL::tsquery' unless $self->{tsquery_rank}; return $self->{tsquery_rank}; }