From: Matt S Trout Date: Sun, 24 Feb 2019 20:46:29 +0000 (+0000) Subject: catch another weird edge case in _order_by X-Git-Tag: v2.000000~3^2~419 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d0a4a580c6a0da92ec1b6b7833b3a16e5d8b4fd2;p=dbsrgits%2FSQL-Abstract.git catch another weird edge case in _order_by --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 0a09edd..78f3ba5 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1130,6 +1130,8 @@ sub _order_by { my ($sql, @bind) = $self->_render_expr($expanded); + return '' unless length($sql); + my $final_sql = $self->_sqlcase(' order by ').$sql; return wantarray ? ($final_sql, @bind) : $final_sql; diff --git a/t/06order_by.t b/t/06order_by.t index e3b94f7..0d340ae 100644 --- a/t/06order_by.t +++ b/t/06order_by.t @@ -58,6 +58,11 @@ my @cases = expects => '', expects_quoted => '', }, + { + given => [ {} ], + expects => '', + expects_quoted => '', + }, { given => [{-desc => [ qw/colA colB/ ] }],