Force xt/ tests to run on anything involving a create_distdir
[dbsrgits/DBIx-Class.git] / t / 90join_torture.t
index cd7d2ef..17d5116 100644 (file)
@@ -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;