X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fprefetch%2Fjoin_type.t;h=e58af4f9a6232b418f6551d604447401fc26726f;hb=9e7525a2cc9d7459ee89a6d2c85913a8b8c4eff9;hp=7b90c874058c2d14e1987a206bad6688205b32b1;hpb=d2fcb9b3612958ecc794acae77520f3da06d3c5b;p=dbsrgits%2FDBIx-Class.git diff --git a/t/prefetch/join_type.t b/t/prefetch/join_type.t index 7b90c87..e58af4f 100644 --- a/t/prefetch/join_type.t +++ b/t/prefetch/join_type.t @@ -1,7 +1,7 @@ use warnings; +use strict; use Test::More; -use Test::Exception; use lib qw(t/lib); use DBIC::SqlMakerTest; use DBICTest; @@ -20,11 +20,16 @@ my $nulls = { # make sure null-prefetches do not screw with the final sql: for my $type (keys %$nulls) { -# is_same_sql_bind ( -# $cds->search({}, { prefetch => { artist => $nulls->{$type} } })->as_query, -# $cds->as_query, -# "same sql with null $type prefetch" -# ); + is_same_sql_bind ( + $cds->search({}, { prefetch => { artist => $nulls->{$type} } })->as_query, + '( SELECT me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track, + artist.artistid, artist.name, artist.rank, artist.charfield + FROM cd me + JOIN artist artist + ON artist.artistid = me.artist + )', [], + "same sql with null $type prefetch" + ); } # make sure left join is carried only starting from the first has_many @@ -39,7 +44,6 @@ is_same_sql_bind ( JOIN artist artist ON artist.artistid = me.artist LEFT JOIN cd cds ON cds.artist = artist.artistid LEFT JOIN artist artist_2 ON artist_2.artistid = cds.artist - ORDER BY cds.artist, cds.year ASC )', [], );