use List::Util 'first';
use Scalar::Util 'blessed';
-use DBIx::Class::_Util qw(UNRESOLVABLE_CONDITION serialize);
+use DBIx::Class::_Util qw(UNRESOLVABLE_CONDITION serialize dump_value);
use SQL::Abstract qw(is_plain_value is_literal_value);
use DBIx::Class::Carp;
use namespace::clean;
( $_ = join ' ', map {
( ! defined $_ ) ? ()
- : ( length ref $_ ) ? (require Data::Dumper::Concise && $self->throw_exception(
- "Unexpected ref in scan-plan: " . Data::Dumper::Concise::Dumper($_)
- ))
+ : ( length ref $_ ) ? $self->throw_exception(
+ "Unexpected ref in scan-plan: " . dump_value $_
+ )
: ( $_ =~ /^\s*$/ ) ? ()
: $_
for (sort keys %$chunk) {
# Match SQLA 1.79 behavior
- if ($_ eq '') {
+ unless( length $_ ) {
is_literal_value($chunk->{$_})
? carp 'Hash-pairs consisting of an empty string with a literal are deprecated, use -and => [ $literal ] instead'
: $self->throw_exception("Supplying an empty left hand side argument is not supported in hash-pairs")
# Match SQLA 1.79 behavior
$self->throw_exception("Supplying an empty left hand side argument is not supported in array-pairs")
- if $where_is_anded_array and (! defined $chunk or $chunk eq '');
+ if $where_is_anded_array and (! defined $chunk or ! length $chunk);
push @pairs, $chunk, shift @pieces;
}
while (@$pairs) {
my ($lhs, $rhs) = splice @$pairs, 0, 2;
- if ($lhs eq '') {
+ if (! length $lhs) {
push @conds, $self->_collapse_cond($rhs);
}
elsif ( $lhs =~ /^\-and$/i ) {
# extra sanity check
if (keys %$p > 1) {
- require Data::Dumper::Concise;
local $Data::Dumper::Deepcopy = 1;
$self->throw_exception(
"Internal error: unexpected collapse unroll:"
- . Data::Dumper::Concise::Dumper { in => { $lhs => $rhs }, out => $p }
+ . dump_value { in => { $lhs => $rhs }, out => $p }
);
}