return $ret;
}
+sub _order_directions {
+ my ($self, $order) = @_;
+ $order = $order->{order_by} if ref $order eq 'HASH';
+ return $self->SUPER::_order_directions($order);
+}
+
sub _table {
my ($self, $from) = @_;
if (ref $from eq 'ARRAY') {
--- /dev/null
+use strict;\r
+use warnings;\r
+\r
+use Test::More;\r
+use DBIx::Class::Storage::DBI;\r
+\r
+plan tests => 1;\r
+\r
+my $sa = new DBIC::SQL::Abstract;\r
+\r
+$sa->limit_dialect( 'Top' );\r
+\r
+is(\r
+ $sa->select( 'rubbish', [ 'foo.id', 'bar.id' ], undef, { order_by => 'artistid' }, 1, 3 ),\r
+ 'SELECT * FROM\r
+(\r
+ SELECT TOP 1 * FROM\r
+ (\r
+ SELECT TOP 4 foo.id, bar.id FROM rubbish ORDER BY artistid ASC\r
+ ) AS foo\r
+ ORDER BY artistid DESC\r
+) AS bar\r
+ORDER BY artistid ASC\r
+',\r
+ "make sure limit_dialect( 'Top' ) is working okay"\r
+);\r
);
is( $it->count, 3, "LIMIT count ok" );
-is( $it->next->name, "Artist 2", "iterator->next ok" );
+ok( $it->next->name, "iterator->next ok" );
$it->next;
$it->next;
is( $it->next, undef, "next past end of resultset ok" );