From: Matt S Trout Date: Wed, 27 Mar 2019 03:58:35 +0000 (+0000) Subject: make weird undef order_by cases explicit X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4e78f98df3e721474f96eaddff50d0f2f0c8bce6;p=scpubgit%2FQ-Branch.git make weird undef order_by cases explicit --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 3f982b3..d5e90ad 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);