X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fprefetch%2Fjoin_type.t;h=f2980e788109827e356f171b407173953d49fea5;hb=18637ebb;hp=1698d6f7757e36082e9145cf776cce3103e94eaf;hpb=908aa1bb761ec1da5c061fe9f687598e3f1934bc;p=dbsrgits%2FDBIx-Class.git diff --git a/t/prefetch/join_type.t b/t/prefetch/join_type.t index 1698d6f..f2980e7 100644 --- a/t/prefetch/join_type.t +++ b/t/prefetch/join_type.t @@ -1,9 +1,9 @@ use warnings; +use strict; use Test::More; use lib qw(t/lib); -use DBIC::SqlMakerTest; -use DBICTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); @@ -19,11 +19,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