X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fprefetch%2Fjoin_type.t;h=ac839f09e0f26483fafca79e0dac9b346cf1b1b0;hb=21aa86aae083ccb5b94ba994dec030627e95e40b;hp=aad32ffb2ca5f86eab21ba91baa9037030f15fed;hpb=0077982b2edc8273ab4b6ea59921177667008cb3;p=dbsrgits%2FDBIx-Class.git diff --git a/t/prefetch/join_type.t b/t/prefetch/join_type.t index aad32ff..ac839f0 100644 --- a/t/prefetch/join_type.t +++ b/t/prefetch/join_type.t @@ -3,8 +3,8 @@ use strict; use Test::More; use lib qw(t/lib); -use DBIC::SqlMakerTest; use DBICTest; +use DBIC::SqlMakerTest; my $schema = DBICTest->init_schema(); @@ -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 me.cdid )', [], );