Bug #17323 | Can't use undefined value as HASH reference at ..../mysql.pm line 113 | ||
---|---|---|---|
Submitted: | 11 Feb 2006 11:26 | Modified: | 29 Dec 2006 17:17 |
Reporter: | Phil Randal | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connectors: DBD::mysql ( Perl ) | Severity: | S3 (Non-critical) |
Version: | 2.903 and later | OS: | Perl |
Assigned to: | CPU Architecture: | Any |
[11 Feb 2006 11:26]
Phil Randal
[12 Feb 2006 9:47]
Valeriy Kravchuk
Thank you for a problem report. Please, check newer versions (3.0002, namely). I see no problem like you described in them.
[12 Feb 2006 12:12]
Phil Randal
That line is missing from mysql.pm 3.0002. It is NOT fixed in 3.0002. If it had already been fixed, I would not have reported the bug. From the synopsis in the documentation: " use DBI; $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; $dbh = DBI->connect($dsn, $user, $password);" and later down " use strict; use DBI(); # Connect to the database. my $dbh = DBI->connect("DBI:mysql:database=test;host=localhost", "joe", "joe's password", {'RaiseError' => 1});" Like I've said and the documentation says, the 4th parameter is optional, and my suggested fix is both obvious and good defensive programming. And it fixes the reported problem. Cheers, Phil
[14 Feb 2006 10:31]
Valeriy Kravchuk
Verified just as described with 3.0002_4. File lib/DBD/mysql.pm should be patched.
[29 Dec 2006 17:17]
Jim Winstead
I haven't been able to reproduce the warning, but I have applied the patch. As far as I can tell, the DBI module always passes a hash along to the driver's connect method, regardless of whether it gets an undefined attrhash passed to DBI->connect or not.