[open-ils-commits] r16695 - branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Reporter (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Jun 12 09:50:47 EDT 2010
Author: miker
Date: 2010-06-12 09:50:45 -0400 (Sat, 12 Jun 2010)
New Revision: 16695
Modified:
branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm
Log:
backporting r16694 -- reporter WHERE clause fixes
Modified: branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm
===================================================================
--- branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm 2010-06-12 04:49:58 UTC (rev 16694)
+++ branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Reporter/SQLBuilder.pm 2010-06-12 13:50:45 UTC (rev 16695)
@@ -944,10 +944,20 @@
$sql .= " NOT IN (". join(",", map { $_->toSQL } @$val).")";
} elsif (lc($op) eq 'is blank') {
- $sql = '('. $self->SUPER::toSQL ." IS NULL OR ". $self->SUPER::toSQL ." = '')";
+ if ($rel && $rel->is_nullable) { # need to redo this
+ $sql = "((". $self->SUPER::toSQL .") IS NULL OR ";
+ } else {
+ $sql = '';
+ }
+ $sql .= '('. $self->SUPER::toSQL ." IS NULL OR ". $self->SUPER::toSQL ." = '')";
} elsif (lc($op) eq 'is not blank') {
- $sql = '('. $self->SUPER::toSQL ." IS NOT NULL AND ". $self->SUPER::toSQL ." <> '')";
+ if ($rel && $rel->is_nullable) { # need to redo this
+ $sql = "((". $self->SUPER::toSQL .") IS NULL OR ";
+ } else {
+ $sql = '';
+ }
+ $sql .= '('. $self->SUPER::toSQL ." IS NOT NULL AND ". $self->SUPER::toSQL ." <> '')";
} elsif (lc($op) eq 'between') {
$sql .= " BETWEEN ". join(" AND ", map { $_->toSQL } @$val);
More information about the open-ils-commits
mailing list