and
my $vref = is_plain_value( (values %$rhs)[0] )
) {
- push @conds, { $lhs => { $subop => $$vref } }
+ push @conds, (
+ (length ref $$vref)
+ ? { $lhs => $rhs }
+ : { $lhs => { $subop => $$vref } }
+ );
}
else {
push @conds, { $lhs => $rhs };
charfield => { -ident => 'foo' },
name => { '=' => { -value => undef } },
rank => { '=' => { -ident => 'bar' } },
+ arrayfield => { '>' => { -value => [3,1] } },
] },
- sql => 'WHERE artistid = ? AND charfield = foo AND name IS NULL AND rank = bar',
normalized => {
artistid => { -value => [1] },
name => undef,
charfield => { '=', { -ident => 'foo' } },
rank => { '=' => { -ident => 'bar' } },
+ arrayfield => { '>' => { -value => [3,1] } },
},
+ sql => 'WHERE artistid = ? AND charfield = foo AND name IS NULL AND rank = bar AND arrayfield > ?',
+ normalized_sql => 'WHERE arrayfield > ? AND artistid = ? AND charfield = foo AND name IS NULL AND rank = bar',
equality_extract => {
artistid => [1],
charfield => { -ident => 'foo' },
}
}
+# test separately
+is_deeply(
+ normalize_sqla_condition( UNRESOLVABLE_CONDITION ),
+ { -and => [ UNRESOLVABLE_CONDITION ] },
+);
+
done_testing;