From: Peter Rabbitson Date: Fri, 4 Dec 2009 14:01:32 +0000 (+0000) Subject: KISS - a select(1) makes perfect ordering criteria X-Git-Tag: v0.08116~103^2~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1475a98b653113fdd138d6928fb1e033412c0e97;p=dbsrgits%2FDBIx-Class.git KISS - a select(1) makes perfect ordering criteria --- diff --git a/lib/DBIx/Class/SQLAHacks/MSSQL.pm b/lib/DBIx/Class/SQLAHacks/MSSQL.pm index 20105a8..ee2e4cf 100644 --- a/lib/DBIx/Class/SQLAHacks/MSSQL.pm +++ b/lib/DBIx/Class/SQLAHacks/MSSQL.pm @@ -13,19 +13,9 @@ use Carp::Clan qw/^DBIx::Class|^SQL::Abstract/; sub _MSRowNumberOver { my ($self, $sql, $order, $rows, $offset ) = @_; - # get the order_by only + # get the order_by only (or make up an order if none exists) my $order_by = $self->_order_by( - (delete $order->{order_by}) || do { - - # no order was supplied - make something up: - my $rsrc = $self->{_dbic_rs_attrs}{_source_handle}->resolve; - if (my @pk = $rsrc->primary_columns) { - \@pk; - } - else { - [($rsrc->columns)[0]]; - } - } + (delete $order->{order_by}) || \ '(SELECT (1))' ); # whatever is left