On Mon, May 18, 2009 at 07:15:21PM +0200, H.Merijn Brand wrote:
> On Fri, 15 May 2009 17:30:44 +0200, "H.Merijn Brand"
> <[email protected]> wrote:
> 
> > How strict should handler attributes be checked?
> > Isn't barfing on fetchrow_hashref () not a tad bit too late in below
> > described situation?

> > my $dbh = DBI->connect ($dsn, $ENV{DBI_USER}, $ENV{DBI_PASS}, {
> >     FetchHashKeyName    => $fhkn,
> >     PrintError          => 1,
> >     RaiseError          => 1,
> >     }) or die $DBI::errstr;

> > /tmp > perl test.pl dbi:Pg: 1
> > DBD::Pg::st fetchrow_hashref failed: Can't use attribute '1' because it 
> > doesn't contain a reference to an array (undef) at test.pl line 19.
> > DBD::Pg::st fetchrow_hashref failed: Can't use attribute '1' because it 
> > doesn't contain a reference to an array (undef) at test.pl line 19.
> > Exit 255

> It is obviously just any of the known statement handle attributes.
> I suggest to make it barf early
> I'm willing to patch DBI if people agree on this

FetchHashKeyName could be set to a driver-specific attribute
(unlikely perhaps, but certainly possible).

I suspect it's a case of "doctor, it hurts when I do this".

Tim.

Reply via email to