[Bast-commits] r6827 -
DBIx-Class/0.08/branches/grouped_prefetch/t/prefetch
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sun Jun 28 13:06:57 GMT 2009
Author: ribasushi
Date: 2009-06-28 13:06:57 +0000 (Sun, 28 Jun 2009)
New Revision: 6827
Modified:
DBIx-Class/0.08/branches/grouped_prefetch/t/prefetch/grouped.t
Log:
Lose the literal sql bits - castaway is right it's silly to support those
Modified: DBIx-Class/0.08/branches/grouped_prefetch/t/prefetch/grouped.t
===================================================================
--- DBIx-Class/0.08/branches/grouped_prefetch/t/prefetch/grouped.t 2009-06-28 12:55:06 UTC (rev 6826)
+++ DBIx-Class/0.08/branches/grouped_prefetch/t/prefetch/grouped.t 2009-06-28 13:06:57 UTC (rev 6827)
@@ -30,13 +30,11 @@
# the select/as is deliberately silly to test both funcs and refs below
select => [
'me.cd',
- \ 'COUNT (me.trackid) AS track_count',
{ count => 'me.trackid' },
],
as => [qw/
cd
track_count
- track_count_2
/],
group_by => [qw/me.cd/],
prefetch => 'cd',
@@ -88,9 +86,9 @@
is_same_sql_bind (
$track_rs->as_query,
'(
- SELECT me.cd, me.track_count, me.track_count_2, cd.cdid, cd.artist, cd.title, cd.year, cd.genreid, cd.single_track
+ SELECT me.cd, me.track_count, cd.cdid, cd.artist, cd.title, cd.year, cd.genreid, cd.single_track
FROM (
- SELECT me.cd, COUNT (me.trackid) AS track_count, COUNT (me.trackid) AS track_count_2
+ SELECT me.cd, COUNT (me.trackid) AS track_count,
FROM track me
WHERE ( cd IN ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) )
GROUP BY me.cd
@@ -136,7 +134,7 @@
select => ['me.cdid', { count => 'tracks.trackid' } ],
as => [qw/cdid track_count/],
group_by => 'me.cdid',
- order_by => { -desc => \ 'COUNT (tracks.trackid)' },
+ order_by => { -desc => 'track_count' },
rows => 2,
});
@@ -168,13 +166,13 @@
LEFT JOIN track tracks ON tracks.cd = me.cdid
WHERE ( tracks.cd IS NOT NULL )
GROUP BY me.cdid
- ORDER BY COUNT (tracks.trackid) DESC,
+ ORDER BY track_count DESC,
LIMIT 2
) me
LEFT JOIN track tracks ON tracks.cd = me.cdid
LEFT JOIN liner_notes liner_notes ON liner_notes.liner_id = me.cdid
WHERE ( tracks.cd IS NOT NULL )
- ORDER BY COUNT (tracks.trackid) DESC, tracks.cd
+ ORDER BY COUNT track_count DESC, tracks.cd
)',
[],
'next() query generated expected SQL',
More information about the Bast-commits
mailing list