my $schema = DBICTest->init_schema();
-plan tests => 23;
+plan tests => 21;
my $rs = $schema->resultset('CD')->search({},
{
}
);
-my @query = @${$rs->as_query};
-TODO: { local $TODO = 'as_query() inconsistent'; is (scalar @query, 2, 'as_query() returned empty bindval arrayref') || push @query, [] }
-
+my ($sql, @bind) = @${$rs->as_query};
is_same_sql_bind (
- @query,
+ $sql,
+ \@bind,
'(SELECT me.cdid, me.title, artist.name FROM cd me JOIN artist artist ON artist.artistid = me.artist)',
[],
'Use of columns attribute results in proper sql'
}
);
-@query = @${$rs->as_query};
-TODO: { local $TODO = 'as_query() inconsistent'; is (scalar @query, 2, 'as_query() returned empty bindval arrayref') || push @query, [] }
-
+($sql, @bind) = @${$rs->as_query};
is_same_sql_bind (
- @query,
+ $sql,
+ \@bind,
'(SELECT me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track, me.cdid, me.title, artist.name FROM cd me JOIN artist artist ON artist.artistid = me.artist)',
[],
'Use of columns attribute results in proper sql'