From: Dagfinn Ilmari Mannsåker Date: Tue, 5 Feb 2013 19:12:46 +0000 (+0000) Subject: Fix -nulls value case-insensitivity X-Git-Tag: v1.74~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b137b0744a3aaea3df1ba497345378e9d3f8da40;p=dbsrgits%2FSQL-Abstract.git Fix -nulls value case-insensitivity --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 6a3fa8e..9b29b5e 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1161,7 +1161,7 @@ sub _order_by_chunks { $val = $arg->{$key}; } elsif ($key =~ /^-nulls$/i) { $nulls = $arg->{$key}; - puke "invalid value for -nulls" unless $nulls =~ /^(?:first|last)$/; + puke "invalid value for -nulls" unless $nulls =~ /^(?:first|last)$/i; } else { puke "invalid key in hash passed to _order_by"; } diff --git a/t/06order_by.t b/t/06order_by.t index f0fb47e..d924569 100644 --- a/t/06order_by.t +++ b/t/06order_by.t @@ -105,7 +105,7 @@ my @cases = bind => [qw/test tost/], }, { - given => [ { -asc => 'colA', -nulls => 'first' }, { -desc => 'colB', -nulls => 'last' } ], + given => [ { -ASC => 'colA', -NULLS => 'FIRST' }, { -DESC => 'colB', -NULLS => 'LAST' } ], expects => ' ORDER BY colA ASC NULLS FIRST, colB DESC NULLS LAST', expects_quoted => ' ORDER BY `colA` ASC NULLS FIRST, `colB` DESC NULLS LAST', },