From: Matt S Trout Date: Wed, 27 Mar 2019 03:58:35 +0000 (+0000) Subject: make weird undef order_by cases explicit X-Git-Tag: v2.000000~3^2~310 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6a2bda022e7b87064f0693a0a28ec0fc562a154a;p=dbsrgits%2FSQL-Abstract.git make weird undef order_by cases explicit --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index e6b46c9..4fa14d6 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1278,7 +1278,9 @@ sub _expand_order_by { ), map $self->expand_expr($_, -ident), map ref($_) eq 'ARRAY' ? @$_ : $_, @to_expand; - return (@exp > 1 ? { -op => [ ',', @exp ] } : $exp[0]); + return undef unless @exp; + return undef if @exp == 1 and not defined($exp[0]); + return +{ -op => [ ',', @exp ] }; }; local @{$self->{expand}}{qw(-asc -desc)} = (($expander) x 2);