[Bast-commits] r8037 -
DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Fri Dec 4 14:01:32 GMT 2009
Author: ribasushi
Date: 2009-12-04 14:01:32 +0000 (Fri, 04 Dec 2009)
New Revision: 8037
Modified:
DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks/MSSQL.pm
Log:
KISS - a select(1) makes perfect ordering criteria
Modified: DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks/MSSQL.pm
===================================================================
--- DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks/MSSQL.pm 2009-12-04 11:52:23 UTC (rev 8036)
+++ DBIx-Class/0.08/branches/mssql_rno_pagination/lib/DBIx/Class/SQLAHacks/MSSQL.pm 2009-12-04 14:01:32 UTC (rev 8037)
@@ -13,19 +13,9 @@
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
More information about the Bast-commits
mailing list