On Wed, Jan 14, 2004 at 05:13:28PM -0000, Avis, Ed wrote:
> >>For DBI, if the driver does not provide an attribute until after
> >>$sth->execute() then the error should indicate this, for example
> >>
> >>    NAME attribute not available with this driver until you execute()
> >>
> >>rather than 'unrecognised attribute'.
> 
> >which of these 2 is it ?
> >
> >DBI.xs:1377:        char *msg = "Can't set %s->{%s}: unrecognised 
> >attribute or invalid value%s";
> >DBI.xs:1664:        croak("Can't get %s->{%s}: unrecognised 
> >attribute",neatsvpv(h,0),key);
> 
> The latter.
> 
> >Ill presume you considered wrapping the $sth->{NAME} in an eval,
> >and executing if you get that specific error.
> 
> Yes, I didn't mean that this change would make DBI more powerful or let
> programs be written more concisely, only that it would make the error
> more obvious to a beginner.

It's a driver bug. The FETCH of the sth NAME attribute should never
reach the DBI's code. The driver should handle it.

Tim.

Reply via email to