[Bast-commits] r7382 -
DBIx-Class/0.08/branches/grouped_has_many_join/t/prefetch
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Tue Aug 25 09:33:40 GMT 2009
Author: ribasushi
Date: 2009-08-25 09:33:40 +0000 (Tue, 25 Aug 2009)
New Revision: 7382
Modified:
DBIx-Class/0.08/branches/grouped_has_many_join/t/prefetch/grouped.t
Log:
One more test
Modified: DBIx-Class/0.08/branches/grouped_has_many_join/t/prefetch/grouped.t
===================================================================
--- DBIx-Class/0.08/branches/grouped_has_many_join/t/prefetch/grouped.t 2009-08-25 09:06:43 UTC (rev 7381)
+++ DBIx-Class/0.08/branches/grouped_has_many_join/t/prefetch/grouped.t 2009-08-25 09:33:40 UTC (rev 7382)
@@ -280,6 +280,25 @@
is($cd_rs->count, 5, 'complex prefetch + non-prefetching has_many join count correct');
is($cd_rs->all, 5, 'complex prefetch + non-prefetching has_many join number of objects correct');
+ # make sure join tracks was thrown out
+ is_same_sql_bind (
+ $cd_rs->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 (
+ SELECT me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track
+ FROM cd me
+ JOIN artist artist ON artist.artistid = me.artist
+ GROUP BY me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track
+ ) me
+ JOIN artist artist ON artist.artistid = me.artist
+ )',
+ [],
+ );
+
+
+
# try the same as above, but add a condition so the tracks join can not be thrown away
my $cd_rs2 = $cd_rs->search ({ 'tracks.title' => { '!=' => 'ugabuganoexist' } });
is($cd_rs2->count, 5, 'complex prefetch + non-prefetching restricted has_many join count correct');
More information about the Bast-commits
mailing list