From: Dagfinn Ilmari Mannsåker Date: Sun, 8 Dec 2013 17:01:03 +0000 (+0000) Subject: Clarify in => undef exception (based on 90c87778) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FQ-Branch.git;a=commitdiff_plain;h=ff8ca6b4ad42a4b4d7adbfc89c820b48e2dd52c0 Clarify in => undef exception (based on 90c87778) --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 9e08585..2bc89eb 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1089,8 +1089,12 @@ sub _where_field_IN { return ("$label $op ( $sql )", @bind); }, + UNDEF => sub { + puke "Argument passed to the '$op' operator can not be undefined"; + }, + FALLBACK => sub { - puke "special op 'in' requires an arrayref (or scalarref/arrayref-ref)"; + puke "special op $op requires an arrayref (or scalarref/arrayref-ref)"; }, }); diff --git a/t/01generate.t b/t/01generate.t index 4962c23..969dd07 100644 --- a/t/01generate.t +++ b/t/01generate.t @@ -580,6 +580,11 @@ my @tests = ( stmt_q => 'SELECT * FROM `test` WHERE ( `a` IS NULL AND `b` IS NOT NULL )', bind => [], }, + { + func => 'select', + args => ['test', '*', { a => { -in => undef } }], + exception_like => qr/Argument passed to the 'IN' operator can not be undefined/, + }, ); for my $t (@tests) {