From: Thomas Berezansky Date: Tue, 14 Aug 2012 17:31:27 +0000 (-0400) Subject: Join subqueries as OR'd groups in QueryParser X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=409c2ebcc648ad32a66ab6d9d2c085744104ae56;p=Evergreen.git Join subqueries as OR'd groups in QueryParser This makes filter_group_entry(1,2,3) build an OR'd set of the resulting queries instead of just tacking them onto each other as ANDs. Signed-off-by: Thomas Berezansky Signed-off-by: Dan Scott --- 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 669bf2068a..cbfd99c1ef 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 @@ -13,15 +13,17 @@ my ${spc} = ' ' x 2; sub subquery_callback { my ($invocant, $self, $struct, $filter, $params, $negate) = @_; - return join( - ' ', - map { - $_->query_text - } @{ - OpenILS::Utils::CStoreEditor - ->new - ->search_actor_search_query({ id => $params }) - } + return sprintf(' ((%s)) ', + join( + ') || (', + map { + $_->query_text + } @{ + OpenILS::Utils::CStoreEditor + ->new + ->search_actor_search_query({ id => $params }) + } + ) ); }