X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsearch%2Frelated_strip_prefetch.t;h=5e34fe9801a08fbc5f3b2285215c46ac359cb34c;hb=b34d93310401fd6f4fd68dc965b4aec592913eb1;hp=10621aeecaf5b5cd665296688278f61aab5fe076;hpb=63e943c2fb6d8d4479fb7d2287dcf4fcad577e99;p=dbsrgits%2FDBIx-Class.git diff --git a/t/search/related_strip_prefetch.t b/t/search/related_strip_prefetch.t index 10621ae..5e34fe9 100644 --- a/t/search/related_strip_prefetch.t +++ b/t/search/related_strip_prefetch.t @@ -2,16 +2,17 @@ use strict; use warnings; use Test::More; -use Test::Exception; use lib qw(t/lib); -use DBIC::SqlMakerTest; -use DBICTest; +use DBICTest ':DiffSQL'; +use DBIx::Class::SQLMaker::LimitDialects; + +my $ROWS = DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype; my $schema = DBICTest->init_schema(); my $rs = $schema->resultset('CD')->search ( - { 'tracks.id' => { '!=', 666 }}, + { 'tracks.trackid' => { '!=', 666 }}, { join => 'artist', prefetch => 'tracks', rows => 2 } ); @@ -26,17 +27,19 @@ is_same_sql_bind ( FROM cd me JOIN artist artist ON artist.artistid = me.artist LEFT JOIN track tracks ON tracks.cd = me.cdid - WHERE ( tracks.id != ? ) - LIMIT 2 + WHERE ( tracks.trackid != ? ) + LIMIT ? ) me JOIN artist artist ON artist.artistid = me.artist - LEFT JOIN track tracks ON tracks.cd = me.cdid - LEFT JOIN tags tags ON tags.cd = me.cdid + JOIN tags tags ON tags.cd = me.cdid WHERE ( tags.tag IS NOT NULL ) GROUP BY tags.tagid, tags.cd, tags.tag )', - [ [ 'tracks.id' => 666 ] ], + [ + [ { sqlt_datatype => 'integer', dbic_colname => 'tracks.trackid' } => 666 ], + [ $ROWS => 2 ] + ], 'Prefetch spec successfully stripped on search_related' );