fixed multiple column count distincts in SQLite and Oracle
[dbsrgits/DBIx-Class.git] / t / run / 01core.tl
index 0bc257a..f5960f6 100644 (file)
@@ -1,7 +1,7 @@
 sub run_tests {
 my $schema = shift;
 
-plan tests => 43; 
+plan tests => 44; 
 
 my @art = $schema->resultset("Artist")->search({ }, { order_by => 'name DESC'});
 
@@ -136,6 +136,15 @@ my $distinct_rs = $schema->resultset("CD")->search($search, { join => 'tags', di
 
 cmp_ok($distinct_rs->all, '==', 4, 'DISTINCT search with OR ok');
 
+my $tcount = $schema->resultset("Track")->search(
+    {},
+    {
+       select => {count => {distinct => ['position', 'title']}},
+       as => ['count']
+    }
+  );
+cmp_ok($tcount->next->get_column('count'), '==', 13, 'multiple column COUNT DISTINCT ok');
+
 my $tag_rs = $schema->resultset('Tag')->search(
                [ { 'me.tag' => 'Cheesy' }, { 'me.tag' => 'Blue' } ]);