projects
/
dbsrgits/SQL-Abstract.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
97a32cd
)
catch another weird edge case in _order_by
Matt S Trout [Sun, 24 Feb 2019 20:46:29 +0000 (20:46 +0000)]
lib/SQL/Abstract.pm
patch
|
blob
|
blame
|
history
t/06order_by.t
patch
|
blob
|
blame
|
history
diff --git
a/lib/SQL/Abstract.pm
b/lib/SQL/Abstract.pm
index
0a09edd
..
78f3ba5
100644
(file)
--- 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
(file)
--- 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/ ] }],