X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F90join_torture.t;h=17d5116a8cffc4d7d3a854387ff8bcd7a4dd0e8f;hb=5cbe5b1216f07b5e329f493bd8bdfa5b0aa0f5eb;hp=cd7d2ef70e68158e2bb5185e239f2730c998ab85;hpb=faeb2407c49717d38874b21749659ac2c632bad7;p=dbsrgits%2FDBIx-Class.git diff --git a/t/90join_torture.t b/t/90join_torture.t index cd7d2ef..17d5116 100644 --- a/t/90join_torture.t +++ b/t/90join_torture.t @@ -146,7 +146,7 @@ lives_ok ( sub { JOIN cd cd ON cd.cdid = me.cd_id JOIN artist artist_2 ON artist_2.artistid = cd.artist GROUP BY me.cd_id - ) count_subq + ) me )', [], ); @@ -154,4 +154,28 @@ lives_ok ( sub { ok (defined $rs->count); }); +# make sure multiplying endpoints do not lose heir join-path +lives_ok (sub { + my $rs = $schema->resultset('CD')->search ( + { }, + { join => { artwork => 'images' } }, + )->get_column('cdid'); + + is_same_sql_bind ( + $rs->as_query, + '( + SELECT me.cdid + FROM cd me + LEFT JOIN cd_artwork artwork + ON artwork.cd_id = me.cdid + LEFT JOIN images images + ON images.artwork_id = artwork.cd_id + )', + [], + ); + + # execution + $rs->next; +}); + done_testing;