From 3a7baccb538efdf1ba6d5d7a13278a2716f5597b Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Sat, 16 Feb 2013 19:03:27 -0500 Subject: [PATCH] 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 --- .../lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm | 1 + 1 file changed, 1 insertion(+) 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}; } -- 2.43.2