X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fprefetch%2Fmultiple_hasmany_torture.t;h=98c3fa393d1f0ab2d5f4109cf8ff673da33d6b18;hb=ce556881780369e33743ef86a0cb183e976d3d19;hp=973df8b92ead89e18a0227310421864c2e1be29f;hpb=9f6555d31bc48b6fa3792f74368fc1f17f77ea60;p=dbsrgits%2FDBIx-Class.git diff --git a/t/prefetch/multiple_hasmany_torture.t b/t/prefetch/multiple_hasmany_torture.t index 973df8b..98c3fa3 100644 --- a/t/prefetch/multiple_hasmany_torture.t +++ b/t/prefetch/multiple_hasmany_torture.t @@ -22,10 +22,11 @@ my $mo_rs = $schema->resultset('Artist')->search( ], result_class => 'DBIx::Class::ResultClass::HashRefInflator', + + order_by => [qw/tracks.position tracks.trackid producer.producerid/], } ); - $schema->resultset('Artist')->create( { name => 'mo', @@ -98,7 +99,6 @@ is_deeply( 'single_track' => undef, 'tracks' => [ { - 'small_dt' => undef, 'cd' => '6', 'position' => '1', 'trackid' => '19', @@ -108,7 +108,6 @@ is_deeply( 'last_updated_at' => undef }, { - 'small_dt' => undef, 'cd' => '6', 'position' => '2', 'trackid' => '20', @@ -118,7 +117,6 @@ is_deeply( 'last_updated_at' => undef }, { - 'small_dt' => undef, 'cd' => '6', 'position' => '3', 'trackid' => '21', @@ -128,7 +126,6 @@ is_deeply( 'last_updated_at' => undef }, { - 'small_dt' => undef, 'cd' => '6', 'position' => '4', 'trackid' => '22', @@ -144,7 +141,6 @@ is_deeply( 'year' => '2021', 'tracks' => [ { - 'small_dt' => undef, 'cd' => '7', 'position' => '1', 'title' => 'singled out', @@ -153,7 +149,6 @@ is_deeply( 'last_updated_on' => undef }, { - 'small_dt' => undef, 'cd' => '7', 'position' => '2', 'title' => 'still alone', @@ -192,23 +187,7 @@ is_deeply( { 'single_track' => undef, 'tracks' => [ - # FIXME - # although the positional ordering is correct, SQLite seems to return - # the rows randomly if an ORDER BY is not supplied. Of course ordering - # by right side of prefetch joins is not yet possible, thus we just hope - # that the order is stable - { - 'small_dt' => undef, - 'cd' => '8', - 'position' => '2', - 'trackid' => '26', - 'title' => 'Bar Foo', - 'cd_single' => undef, - 'last_updated_on' => undef, - 'last_updated_at' => undef - }, { - 'small_dt' => undef, 'cd' => '8', 'position' => '1', 'trackid' => '25', @@ -218,7 +197,15 @@ is_deeply( 'cd_single' => undef, }, { - 'small_dt' => undef, + 'cd' => '8', + 'position' => '2', + 'trackid' => '26', + 'title' => 'Bar Foo', + 'cd_single' => undef, + 'last_updated_on' => undef, + 'last_updated_at' => undef + }, + { 'cd' => '8', 'position' => '3', 'trackid' => '27', @@ -234,7 +221,6 @@ is_deeply( 'year' => '2020', 'tracks' => [ { - 'small_dt' => undef, 'cd' => '9', 'position' => '1', 'title' => 'singled out', @@ -243,7 +229,6 @@ is_deeply( 'last_updated_on' => undef }, { - 'small_dt' => undef, 'cd' => '9', 'position' => '2', 'title' => 'still alone',