[Dbix-class] SQL::Abstract regression?

Rob Kinyon rob.kinyon at gmail.com
Mon Jul 13 16:18:04 GMT 2009

On Mon, Jul 13, 2009 at 12:11, Paul Makepeace<paulm at paulm.com> wrote:
> On Mon, Jul 13, 2009 at 11:03 AM, Rob Kinyon<rob.kinyon at gmail.com> wrote:
>> On Mon, Jul 13, 2009 at 11:52, Paul Makepeace<paulm at paulm.com> wrote:
>> [snip]
>>> specifically, FROM (SELECT COUNT( publication_story.uid ) AS
>>> story_count, ... looks wrong. Or should I update my code somehow?
>>> This error coincides with upgrading to latest DBIx::Class today.
>> What do you expect to see?
> My question is what do _you_ expect to see?
>   select => [{ count => 'publication_story.uid' }, ...
>   as => [qw/story_count ...
> I would fairly reasonably expect to produce SELECT
> COUNT(publication_story.uid) AS story_count and not have that appear
> in the FROM clause (?!)
> This has been working until today when I upgraded, so a recent version
> of $module has broken this.

Note: I have no idea what you used to get, so that's why I asked what
you expected. I don't have your query in my app, so I have no idea
what you are using this for. And, frankly, I don't have time to parse
a 100-term query to figure out the one thing that broke. If you tell
me what you think you should get, you get better answers.

Problem: as => doesn't actually affect the SQL. It only provides
$row->get_column('story_count'), not "COUNT(publication_story.uid) AS

Suggestion: Try it without the prefetch. One of the major changes in
the last fix was changing how prefetch works to make it work better in
certain cases. This looks like a possible regression.


More information about the DBIx-Class mailing list