[open-ils-commits] r20296 - in branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage: . Driver/Pg (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Apr 22 17:35:36 EDT 2011
Author: miker
Date: 2011-04-22 17:35:30 -0400 (Fri, 22 Apr 2011)
New Revision: 20296
Modified:
branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm
Log:
address the empty-query case
Modified: branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
===================================================================
--- branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm 2011-04-22 21:34:56 UTC (rev 20295)
+++ branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm 2011-04-22 21:35:30 UTC (rev 20296)
@@ -585,6 +585,13 @@
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 = <<SQL;
SELECT $key AS id,
ARRAY_ACCUM(DISTINCT m.source) AS records,
@@ -600,7 +607,7 @@
$during
$between
$combined_dyn_filters
- AND $$flat_plan{where}
+ $flat_where
GROUP BY 1
ORDER BY 4 $desc NULLS LAST, 5 DESC NULLS LAST, 3 DESC
LIMIT $core_limit
Modified: branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm
===================================================================
--- branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm 2011-04-22 21:34:56 UTC (rev 20295)
+++ branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm 2011-04-22 21:35:30 UTC (rev 20296)
@@ -685,7 +685,7 @@
}
- $struct = undef if (scalar(@{$struct->query_nodes}) == 0);
+ $struct = undef if (scalar(@{$struct->query_nodes}) == 0 && !$struct->top_plan);
return $struct if !wantarray;
return ($struct, $remainder);
More information about the open-ils-commits
mailing list