X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fprefetch%2Fwith_limit.t;h=97dffcc5de4efd8a2be8ab2d5e8e952a2957b3b4;hb=76031e147d6f0d80ab3ec73a12d373962ade1252;hp=046678e090ed442595695ed54cfd32d85f50062c;hpb=fcb7fcbb6bde5f9a211c62011b3110f07828caec;p=dbsrgits%2FDBIx-Class.git diff --git a/t/prefetch/with_limit.t b/t/prefetch/with_limit.t index 046678e..97dffcc 100644 --- a/t/prefetch/with_limit.t +++ b/t/prefetch/with_limit.t @@ -34,7 +34,7 @@ my $use_prefetch = $no_prefetch->search( } ); -# add a floating +select to make sure it does not throw things off +# add an extra +select to make sure it does not throw things off # we also expect it to appear in both selectors, as we can not know # for sure which part of the query it applies to (may be order_by, # maybe something else) @@ -43,7 +43,7 @@ my $use_prefetch = $no_prefetch->search( # is_deeply picks up this difference too (not sure if bug or # feature) $use_prefetch = $use_prefetch->search({}, { - '+select' => \[ 'me.artistid + ?', [ \ 'inTEger' => 1 ] ], + '+columns' => { monkeywrench => \[ 'me.artistid + ?', [ \ 'inTEger' => 1 ] ] }, }); my $bind_int_resolved = sub { [ { sqlt_datatype => 'inTEger' } => 1 ] }; @@ -54,12 +54,12 @@ my $bind_vc_resolved = sub { [ is_same_sql_bind ( $use_prefetch->as_query, '( - SELECT me.artistid, me.name, - cds.cdid, cds.artist, cds.title, cds.year, cds.genreid, cds.single_track, - me.artistid + ? + SELECT me.artistid + ?, + me.artistid, me.name, + cds.cdid, cds.artist, cds.title, cds.year, cds.genreid, cds.single_track FROM ( - SELECT me.artistid, me.name, - me.artistid + ? + SELECT me.artistid + ?, + me.artistid, me.name FROM artist me LEFT JOIN cd cds ON cds.artist = me.artistid @@ -69,7 +69,7 @@ is_same_sql_bind ( ON tracks.cd = cds.cdid WHERE artwork.cd_id IS NULL OR tracks.title != ? - GROUP BY me.artistid, me.name, me.artistid + ? + GROUP BY me.artistid + ?, me.artistid, me.name ORDER BY name DESC LIMIT ? ) me LEFT JOIN cd cds @@ -80,8 +80,8 @@ is_same_sql_bind ( ON tracks.cd = cds.cdid WHERE artwork.cd_id IS NULL OR tracks.title != ? - GROUP BY me.artistid, me.name, cds.cdid, cds.artist, cds.title, cds.year, cds.genreid, cds.single_track, me.artistid + ? - ORDER BY name DESC, cds.artist, cds.year ASC + GROUP BY me.artistid + ?, me.artistid, me.name, cds.cdid, cds.artist, cds.title, cds.year, cds.genreid, cds.single_track + ORDER BY name DESC )', [ $bind_int_resolved->(), # outer select @@ -190,7 +190,6 @@ is_same_sql_bind ( JOIN artist artist ON artist.artistid = me.artist WHERE ( ( artist.name = ? AND me.year = ? ) ) - ORDER BY tracks.cd )', [ [ { sqlt_datatype => 'varchar', sqlt_size => 100, dbic_colname => 'artist.name' } => 'foo' ],