Allow caller to supply a PG-encoded array string to test against a column value.
Also, repair relative week transform that has never worked.
Sponsored-by: C/W MARS
Sponsored-by: Missouri Evergreen Consortium
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org>
Signed-off-by: rfrasur <rfrasur@library.in.gov>
my $val = $self->{params};
$val = $$val[0] if (ref($val));
- return "EXTRACT(WEEK FROM \$_$$\$rtime\$_$$\$::TIMESTAMPTZ + \$_$$\$val weeks\$_$$\$)";
+ return "EXTRACT(WEEK FROM \$_$$\$rtime\$_$$\$::TIMESTAMPTZ + \$_$$\$$val weeks\$_$$\$)";
}
} else {
$sql = '';
}
- $sql .= "$val = ANY (".$self->SUPER::toSQL.")";
+ $sql .= "(".$self->SUPER::toSQL.") = ANY ($val)";
} elsif (lc($op) eq '<> any') {
$val = $$val[0] if (ref($val) eq 'ARRAY');
} else {
$sql = '';
}
- $sql .= "$val <> ANY (".$self->SUPER::toSQL.")";
+ $sql .= "(".$self->SUPER::toSQL.") <> ANY ($val)";
} elsif (lc($op) eq 'is blank') {
if ($rel && $rel->is_nullable) { # need to redo this