[Bast-commits] r8175 - DBIx-Class/0.08/branches/mssql_limit_regression/t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Thu Dec 24 15:22:30 GMT 2009


Author: ribasushi
Date: 2009-12-24 15:22:30 +0000 (Thu, 24 Dec 2009)
New Revision: 8175

Modified:
   DBIx-Class/0.08/branches/mssql_limit_regression/t/746mssql.t
Log:
Ordered subqueries do not work in mssql after all

Modified: DBIx-Class/0.08/branches/mssql_limit_regression/t/746mssql.t
===================================================================
--- DBIx-Class/0.08/branches/mssql_limit_regression/t/746mssql.t	2009-12-24 15:17:43 UTC (rev 8174)
+++ DBIx-Class/0.08/branches/mssql_limit_regression/t/746mssql.t	2009-12-24 15:22:30 UTC (rev 8175)
@@ -220,6 +220,7 @@
   ]);
 }, 'populate with PKs supplied ok' );
 
+
 lives_ok (sub {
   # start a new connection, make sure rebless works
   # test an insert with a supplied identity, followed by one without
@@ -256,7 +257,8 @@
 
 # make sure ordered subselects work
 {
-  my $owners = $schema->resultset ('Owners')->search ({}, { order_by => 'name' });
+  my $owners = $schema->resultset ('Owners')->search ({}, { order_by => 'name', offset => 2, rows => 3 });
+
   my $al = $owners->current_source_alias;
   my $sealed_owners = $owners->result_source->resultset->search (
     {},
@@ -275,6 +277,22 @@
     [ map { $_->name } ($owners->all) ],
     'Sort preserved from within a subquery',
   );
+
+
+  my $corelated_owners = $owners->result_source->resultset->search (
+    {
+      id => { -in => $owners->get_column('id')->as_query },
+    },
+    {
+      order_by => 'name'
+    },
+  );
+
+  is_deeply (
+    [ map { $_->name } ($corelated_owners->all) ],
+    [ map { $_->name } ($owners->all) ],
+    'Sort preserved from within a corelated subquery',
+  );
 }
 
 TODO: {




More information about the Bast-commits mailing list