The fact that count(*) shows up as "count" in the field name isn't driven by
DBI - it's driver dependent.

Sybase has it as an "unnamed column" (or at least it used to) ... only way
to get at it would be with an arrayref!

You shouldn't rely on unnamed derived expression columns having a particular
name ... and it should not be documented as behaving in a particular way by
DBI, since drivers might change.

If you use count(*) ... instead use count(*) as the_count
.... being explicit will avoid problems.


On Thu, Jan 28, 2010 at 12:12 PM, H.Merijn Brand <h.m.br...@xs4all.nl>wrote:

> On Thu, 28 Jan 2010 11:59:16 -0500, Erik Aronesty <earone...@gmail.com>
> wrote:
>
> > Just use the *_arrayref versions for multiple fields with the same name
> > instead of hashref or slice{}
>
> That is what I've shown. Bind_columns () or aliasing also works.
>
> > You can't reliably refer to fields by name if they overlap.
>
> indeed, which is what I have shown.
> I'm not complaining here or filing a bug report. I'm probing for
> opinions in how to document this.
>
> I *do* think that count, count (*) mapping to count, count /is/ a bug.
>
> --
> H.Merijn Brand  http://tux.nl      Perl Monger  http://amsterdam.pm.org/
> using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
> 11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
> http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
> http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/
>

Reply via email to