From: Matt S Trout Date: Fri, 20 Apr 2012 10:52:37 +0000 (+0000) Subject: ORDER BY never generates ASC X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b6b6113e2a7027e441879d914a620bdfc90d51e1;p=dbsrgits%2FData-Query.git ORDER BY never generates ASC --- diff --git a/lib/Data/Query/Renderer/SQL/Naive.pm b/lib/Data/Query/Renderer/SQL/Naive.pm index c4ac4b3..42ee8b4 100644 --- a/lib/Data/Query/Renderer/SQL/Naive.pm +++ b/lib/Data/Query/Renderer/SQL/Naive.pm @@ -366,8 +366,8 @@ sub _render_order { my @ret = ( $self->_format_keyword('ORDER BY'), $self->_render($dq->{by}), - (defined $dq->{reverse} - ? $self->_format_keyword($dq->{reverse} ? 'DESC' : 'ASC') + ($dq->{reverse} + ? $self->_format_keyword('DESC') : ()) ); my $from; @@ -377,8 +377,8 @@ sub _render_order { push @ret, ( ',', $self->_render($dq->{by}), - (exists $dq->{reverse} - ? $self->_format_keyword($dq->{reverse} ? 'DESC' : 'ASC') + ($dq->{reverse} + ? $self->_format_keyword('DESC') : ()) ); }