Merge 'trunk' into 'cdbicompat_integration'
[dbsrgits/DBIx-Class.git] / t / 42toplimit.t
CommitLineData
f48dd03f 1use strict;\r
2use warnings;\r
3\r
4use Test::More;\r
5use DBIx::Class::Storage::DBI;\r
6\r
7plan tests => 1;\r
8\r
9my $sa = new DBIC::SQL::Abstract;\r
10\r
11$sa->limit_dialect( 'Top' );\r
12\r
13is(\r
14 $sa->select( 'rubbish', [ 'foo.id', 'bar.id' ], undef, { order_by => 'artistid' }, 1, 3 ),\r
15 'SELECT * FROM\r
16(\r
17 SELECT TOP 1 * FROM\r
18 (\r
19 SELECT TOP 4 foo.id, bar.id FROM rubbish ORDER BY artistid ASC\r
20 ) AS foo\r
21 ORDER BY artistid DESC\r
22) AS bar\r
23ORDER BY artistid ASC\r
24',\r
25 "make sure limit_dialect( 'Top' ) is working okay"\r
26);\r