Massive rewrite of bind handling, and overall simplification of ::Storage::DBI
[dbsrgits/DBIx-Class.git] / t / prefetch / o2m_o2m_order_by_with_limit.t
index c593379..a4476c3 100644 (file)
@@ -26,7 +26,7 @@ is_same_sql_bind(
   $filtered_cd_rs->as_query,
   q{(
     SELECT  cds_unordered.cdid, cds_unordered.artist, cds_unordered.title, cds_unordered.year, cds_unordered.genreid, cds_unordered.single_track,
-            tracks.trackid, tracks.cd, tracks.position, tracks.title, tracks.last_updated_on, tracks.last_updated_at, tracks.small_dt
+            tracks.trackid, tracks.cd, tracks.position, tracks.title, tracks.last_updated_on, tracks.last_updated_at
       FROM artist me
       JOIN (
         SELECT cds_unordered.cdid, cds_unordered.artist, cds_unordered.title, cds_unordered.year, cds_unordered.genreid, cds_unordered.single_track
@@ -34,7 +34,6 @@ is_same_sql_bind(
           JOIN cd cds_unordered
             ON cds_unordered.artist = me.artistid
         WHERE ( me.rank = ? )
-        GROUP BY cds_unordered.cdid, cds_unordered.artist, cds_unordered.title, cds_unordered.year, cds_unordered.genreid, cds_unordered.single_track, me.name, me.artistid
         ORDER BY me.name ASC, me.artistid DESC
         LIMIT 3
         OFFSET 3
@@ -45,7 +44,9 @@ is_same_sql_bind(
     WHERE ( me.rank = ? )
     ORDER BY me.name ASC, me.artistid DESC, tracks.cd
   )},
-  [ [ 'me.rank' => 13 ], [ 'me.rank' => 13 ] ],
+  [ map { [ { sqlt_datatype => 'integer', dbic_colname => 'me.rank' }
+            => 13 ] } (1,2)
+  ],
   'correct SQL on limited prefetch over search_related ordered by root',
 );
 
@@ -71,7 +72,6 @@ is_deeply (
           'last_updated_at' => undef,
           'last_updated_on' => undef,
           'position' => '1',
-          'small_dt' => undef,
           'title' => 'Boring Name',
           'trackid' => '10'
         },
@@ -80,7 +80,6 @@ is_deeply (
           'last_updated_at' => undef,
           'last_updated_on' => undef,
           'position' => '2',
-          'small_dt' => undef,
           'title' => 'Boring Song',
           'trackid' => '11'
         },
@@ -89,7 +88,6 @@ is_deeply (
           'last_updated_at' => undef,
           'last_updated_on' => undef,
           'position' => '3',
-          'small_dt' => undef,
           'title' => 'No More Ideas',
           'trackid' => '12'
         }
@@ -108,7 +106,6 @@ is_deeply (
           'last_updated_at' => undef,
           'last_updated_on' => undef,
           'position' => '1',
-          'small_dt' => undef,
           'title' => 'Sad',
           'trackid' => '13'
         },
@@ -117,7 +114,6 @@ is_deeply (
           'last_updated_at' => undef,
           'last_updated_on' => undef,
           'position' => '3',
-          'small_dt' => undef,
           'title' => 'Suicidal',
           'trackid' => '15'
         },
@@ -126,7 +122,6 @@ is_deeply (
           'last_updated_at' => undef,
           'last_updated_on' => undef,
           'position' => '2',
-          'small_dt' => undef,
           'title' => 'Under The Weather',
           'trackid' => '14'
         }