From: Matt S Trout Date: Mon, 4 Nov 2013 03:05:08 +0000 (+0000) Subject: add support for nulls => "none" in order nodes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e1ba0ad98de5b5877d5ca5eaf95e7c8c87d2afe1;p=dbsrgits%2FSQL-Abstract.git add support for nulls => "none" in order nodes --- diff --git a/lib/SQL/Abstract/Converter.pm b/lib/SQL/Abstract/Converter.pm index e5387ce..935b601 100644 --- a/lib/SQL/Abstract/Converter.pm +++ b/lib/SQL/Abstract/Converter.pm @@ -536,7 +536,7 @@ sub _order_by_to_dq { my $dq = Order( undef, (defined($dir) ? (!!($dir =~ /desc/i)) : undef), - (defined($nulls) ? ($nulls =~ /first/i ? 1 : -1) : undef), + $nulls, ($from ? ($from) : undef), ); @@ -594,7 +594,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)$/i; + die "invalid value for -nulls" unless $nulls =~ /^(?:first|last|none)$/i; } else { die "invalid key ${key} in hash passed to _order_by_to_dq"; }