Bug report for version 2.9003

Bug report for version 2.9003

am 17.11.2003 20:36:13 von Chris Radcliff

Hello,

I'm not certain that this is the place to post bug reports, but I
figured I'd start here and mail the developers directly only if you
suggest it.

On line 112 of mysql.pm version 2.9003, the connect() method copies the
$attrhash into a $privateAttrHash variable, then creates a more
complete $privateAttrHash in lines 113 to 118, like so:

my($this, $privateAttrHash) = (undef, $attrhash);
$privateAttrHash = { %$privateAttrHash,
'Name' => $dsn,
'user' => $username,
'password' => $password
};

However, $attrhash is brought in as an optional argument to connect(),
so it's possible (and likely) for it to be undefined. This causes a
fatal error on line 113, "can't use an undefined value as a HASH
reference" or similar.

The change that worked for me was to add this line before 112:

$attrhash ||= {};

This doesn't seem to affect any other behaviors. Hopefully a change
like this will make it into the next revision of mysql.pm.

Let me know if you have any questions or suggestions.

Cheers,
_________________________
Chris Radcliff
Senior Software Engineer
Console, Inc.
chris@globalspin.com
http://www.console.net


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org