[Bast-commits] r6147 -
DBIx-Class/0.08/branches/count_distinct/t/search
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Wed May 6 15:40:32 GMT 2009
Author: ribasushi
Date: 2009-05-06 15:40:31 +0000 (Wed, 06 May 2009)
New Revision: 6147
Modified:
DBIx-Class/0.08/branches/count_distinct/t/search/subquery.t
Log:
Add subquery/from test by michaelr (copied from subquery branch r5742)
Modified: DBIx-Class/0.08/branches/count_distinct/t/search/subquery.t
===================================================================
--- DBIx-Class/0.08/branches/count_distinct/t/search/subquery.t 2009-05-06 13:29:39 UTC (rev 6146)
+++ DBIx-Class/0.08/branches/count_distinct/t/search/subquery.t 2009-05-06 15:40:31 UTC (rev 6147)
@@ -7,7 +7,7 @@
use Test::More;
-plan ( tests => 7 );
+plan ( tests => 8 );
use lib qw(t/lib);
use DBICTest;
@@ -168,4 +168,24 @@
);
}
+{
+ my $rs = $cdrs->search(
+ {},
+ {
+ alias => 'cd2',
+ from => [
+ { cd2 => $cdrs->search({ title => 'Thriller' })->as_query },
+ ],
+ },
+ );
+
+ my $arr = $rs->as_query;
+ my ($query, @bind) = @{$$arr};
+ is_same_sql_bind(
+ $query, \@bind,
+ "(SELECT cd2.cdid, cd2.artist, cd2.title, cd2.year, cd2.genreid, cd2.single_track FROM (SELECT me.cdid,me.artist,me.title,me.year,me.genreid,me.single_track FROM cd me WHERE title = ?) cd2)",
+ ['Thriller'],
+ );
+}
+
__END__
More information about the Bast-commits
mailing list