X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsearch%2Frelated_strip_prefetch.t;h=76336b1dbba3d29e8fef888bd40ff918de5e6806;hb=130f0abd0ea76114ffdea39a4fea352a35e5e742;hp=0745baf2ff89c9f48953d48e7c7cd781f79eabbe;hpb=0e773352a9c6c034dfb2526b8d68bf6ac1e2323b;p=dbsrgits%2FDBIx-Class.git diff --git a/t/search/related_strip_prefetch.t b/t/search/related_strip_prefetch.t index 0745baf..76336b1 100644 --- a/t/search/related_strip_prefetch.t +++ b/t/search/related_strip_prefetch.t @@ -2,11 +2,13 @@ use strict; use warnings; use Test::More; -use Test::Exception; use lib qw(t/lib); -use DBIC::SqlMakerTest; use DBICTest; +use DBIC::SqlMakerTest; +use DBIx::Class::SQLMaker::LimitDialects; + +my $ROWS = DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype; my $schema = DBICTest->init_schema(); @@ -25,9 +27,9 @@ is_same_sql_bind ( SELECT me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track FROM cd me JOIN artist artist ON artist.artistid = me.artist - LEFT JOIN track tracks ON tracks.cd = me.cdid + LEFT JOIN track tracks ON tracks.cd = me.cdid WHERE ( tracks.trackid != ? ) - LIMIT 2 + LIMIT ? ) me JOIN artist artist ON artist.artistid = me.artist JOIN tags tags ON tags.cd = me.cdid @@ -35,8 +37,9 @@ is_same_sql_bind ( GROUP BY tags.tagid, tags.cd, tags.tag )', - [ [ { sqlt_datatype => 'integer', dbic_colname => 'tracks.trackid' } - => 666 ] + [ + [ { sqlt_datatype => 'integer', dbic_colname => 'tracks.trackid' } => 666 ], + [ $ROWS => 2 ] ], 'Prefetch spec successfully stripped on search_related' );