X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F76select.t;h=7560d2c5990c5758b19447dac8d56fcdb6681d6e;hb=f6a14bd4c44420c2e4b2f6d2467cd59e2f28e2d3;hp=40045b40325d40d994cd154a041b9eb2e69eb1f3;hpb=b3b13ec9d9282b33919420131a6793382d758b9c;p=dbsrgits%2FDBIx-Class.git diff --git a/t/76select.t b/t/76select.t index 40045b4..7560d2c 100644 --- a/t/76select.t +++ b/t/76select.t @@ -64,6 +64,7 @@ my $cds = $schema->resultset ('CD')->search ({}, { order_by => 'me.cdid'}); # ma cmp_ok ($cds->count, '>', 2, 'Initially populated with more than 2 CDs'); my $table = $cds->result_source->name; +$table = $$table if ref $table eq 'SCALAR'; my $subsel = $cds->search ({}, { columns => [qw/cdid title/], from => \ "(SELECT cdid, title FROM $table LIMIT 2) me", @@ -84,10 +85,8 @@ $rs = $schema->resultset('CD')->search({}, } ); -my ($sql, @bind) = @${$rs->as_query}; is_same_sql_bind ( - $sql, - \@bind, + $rs->as_query, '(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' @@ -114,10 +113,8 @@ $rs = $schema->resultset('CD')->search({}, } ); -($sql, @bind) = @${$rs->as_query}; is_same_sql_bind ( - $sql, - \@bind, + $rs->as_query, '(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'