It's ambiguous whether the user meant [ undef ] or [], or forgot to
assign to a variable intended to hold an arrayref.
}
};
if ($op eq 'BETWEEN' or $op eq 'IN' or $op eq 'NOT IN' or $op eq 'NOT BETWEEN') {
+ die "Can't use undef argument for operator $op" unless defined $rhs;
$rhs = [$rhs] unless ref $rhs;
if (ref($rhs) ne 'ARRAY') {
if ($op =~ /IN$/) {
stmt_q => 'SELECT * FROM `test` WHERE ( `a` IS NOT NULL AND `b` IS NOT NULL )',
bind => [],
},
+ {
+ func => 'select',
+ args => ['test', '*', { a => { -in => undef } }],
+ exception_like => qr/Can't use undef argument for operator IN/,
+ },
);
for my $t (@tests) {