7 use DBICTest ':DiffSQL';
8 use DBIx::Class::SQLMaker::LimitDialects;
10 my $ROWS = DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype;
12 my $schema = DBICTest->init_schema();
14 my $rs = $schema->resultset('CD')->search (
15 { 'tracks.trackid' => { '!=', 666 }},
16 { join => 'artist', prefetch => 'tracks', rows => 2 }
19 my $rel_rs = $rs->search_related ('tags', { 'tags.tag' => { '!=', undef }}, { distinct => 1});
24 SELECT tags.tagid, tags.cd, tags.tag
26 SELECT me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track
28 JOIN artist artist ON artist.artistid = me.artist
29 LEFT JOIN track tracks ON tracks.cd = me.cdid
30 WHERE ( tracks.trackid != ? )
33 JOIN artist artist ON artist.artistid = me.artist
34 JOIN tags tags ON tags.cd = me.cdid
35 WHERE ( tags.tag IS NOT NULL )
36 GROUP BY tags.tagid, tags.cd, tags.tag
40 [ { sqlt_datatype => 'integer', dbic_colname => 'tracks.trackid' } => 666 ],
43 'Prefetch spec successfully stripped on search_related'