From: Dagfinn Ilmari Mannsåker Date: Tue, 5 Feb 2013 19:14:38 +0000 (+0000) Subject: Fix -nulls value case-insensitivity X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0f87e4f02aced2fbbc19043b459f0a6256f1436d;p=dbsrgits%2FSQL-Abstract.git Fix -nulls value case-insensitivity --- diff --git a/lib/SQL/Abstract/Converter.pm b/lib/SQL/Abstract/Converter.pm index 1f5414b..cf168cd 100644 --- a/lib/SQL/Abstract/Converter.pm +++ b/lib/SQL/Abstract/Converter.pm @@ -576,7 +576,7 @@ sub _order_by_to_dq { $val = $arg->{$key}; } elsif ($key =~ /^-nulls$/i) { $nulls = $arg->{$key}; - die "invalid value for -nulls" unless $nulls =~ /^(?:first|last)$/; + die "invalid value for -nulls" unless $nulls =~ /^(?:first|last)$/i; } else { die "invalid key in hash passed to _order_by_to_dq"; } diff --git a/t/06order_by.t b/t/06order_by.t index 2b3b13f..00a83cd 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 NULLS FIRST, colB DESC NULLS LAST', expects_quoted => ' ORDER BY `colA` NULLS FIRST, `colB` DESC NULLS LAST', },