From 9a07c93b4f3b17824e315a1063e2c97b29647d75 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 22 Apr 2011 21:37:12 +0000 Subject: [PATCH] address the empty-query case git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@20297 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Storage/Driver/Pg/QueryParser.pm | 9 ++++++++- Open-ILS/src/perlmods/OpenILS/Application/Storage/QueryParser.pm | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm index 2b15e0231d..c1fb759811 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm @@ -523,6 +523,13 @@ sub toSQL { my $core_limit = $self->QueryParser->core_limit || 25000; + my $flat_where = $$flat_plan{where}; + if ($flat_where eq '()') { + $flat_where = ''; + } else { + $flat_where = "AND $flat_where"; + } + my $sql = <query_nodes}) == 0); + $struct = undef if (scalar(@{$struct->query_nodes}) == 0 && !$struct->top_plan); return $struct if !wantarray; return ($struct, $remainder); -- 2.11.0