X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F22op_value.t;h=8ccc52b7f3e4837f612de01a5ef44fdd9036b68e;hb=cf5b7ab163f8ac123ebc9bb1156e79646cd5bd2f;hp=00cb5c51d95e0340ad631e087fa6cdcb2f1e81fa;hpb=cc4228955c41e945e3515aa9d77266a0dacc43af;p=scpubgit%2FQ-Branch.git diff --git a/t/22op_value.t b/t/22op_value.t index 00cb5c5..8ccc52b 100644 --- a/t/22op_value.t +++ b/t/22op_value.t @@ -14,7 +14,7 @@ for my $col_btype (0,1) { $col_btype ? (bindtype => 'columns') : (), ); - my ($sql, @bind) = $sql_maker->select ('artist', '*', { arr1 => { -value => [1,2] }, arr2 => { '>', { -value => [3,4] } }, field => [5,6] } ); + my ($sql, @bind) = $sql_maker->select('artist', '*', { arr1 => { -value => [1,2] }, arr2 => { '>', { -value => [3,4] } }, field => [5,6] } ); is_same_sql_bind ( $sql, @@ -40,6 +40,38 @@ for my $col_btype (0,1) { ) ], ); + + { + local $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /Supplying an undefined argument to '(?:NOT )?LIKE'/ }; + + ($sql, @bind) = $sql_maker->where({ + c1 => undef, + c2 => { -value => undef }, + c3 => { '=' => { -value => undef } }, + c4 => { '!=' => { -value => undef } }, + c5 => { '<>' => { -value => undef } }, + c6 => { '-like' => { -value => undef } }, + c7 => { '-not_like' => { -value => undef } }, + c8 => { 'is' => { -value => undef } }, + c9 => { 'is not' => { -value => undef } }, + }); + + is_same_sql_bind ( + $sql, + \@bind, + "WHERE ${q}c1${q} IS NULL + AND ${q}c2${q} IS NULL + AND ${q}c3${q} IS NULL + AND ${q}c4${q} IS NOT NULL + AND ${q}c5${q} IS NOT NULL + AND ${q}c6${q} IS NULL + AND ${q}c7${q} IS NOT NULL + AND ${q}c8${q} IS NULL + AND ${q}c9${q} IS NOT NULL + ", + [], + ); + } }} done_testing;