From 409c2ebcc648ad32a66ab6d9d2c085744104ae56 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Tue, 14 Aug 2012 13:31:27 -0400 Subject: [PATCH] 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 --- .../Storage/Driver/Pg/QueryParser.pm | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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 }) + } + ) ); } -- 2.43.2