# 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