From: miker Date: Fri, 22 Apr 2011 21:35:30 +0000 (+0000) Subject: address the empty-query case X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ff94823e92cf0938919bfc861a8cdd4c5b71a287;p=evergreen%2Fjoelewis.git address the empty-query case git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_1@20296 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- 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 191542434c..b858fd55bd 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 @@ -585,6 +585,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);