On Tue, Mar 29, 2005 at 11:32:45PM -0500, Stas Bekman wrote:
> Tim Bunce wrote:
> >Still no time to dig, but it sounds like an tie inner vs outer issue.
> >If you're using the outer handle then you'll need to mg_get() to fire 
> >FETCH.
> >If that's not it then perhaps you could send me a patch (svn diff)
> >which'll get me to where you're at.
> 
> The problem was that it was looking for the value in the wrong place. 

Ah. No. The problem is that DBD::mysql isn't passing the attributes
through $drh->connect into DBI::_new_dbh the way it should.

[The DBD::mysql driver is non-typical ('non-standard' would be too
strong) in it's use of the (very old) $imp_data parameter to
DBI::_new_dbh().]

The most basic and narrow fix would probably be:

--- lib/DBD/mysql.pm    Wed Mar 30 11:54:19 2005
+++ lib/DBD/mysql.pm.orig       Wed Mar 30 11:53:58 2005
@@ -119,7 +119,7 @@
     DBD::mysql->_OdbcParse($dsn, $privateAttrHash,
                                    ['database', 'host', 'port']);

-    if (!defined($this = DBI::_new_dbh($drh, {'Name' => $dsn, dbi_imp_data => 
$attrhash->{dbi_imp_data} },
+    if (!defined($this = DBI::_new_dbh($drh, {'Name' => $dsn},
                                       $privateAttrHash))) {
        return undef;
     }

but really the code in that function needs a major reorg
and dbdimp.c should be implementing dbd_db_login6 (which
passes in $attr) not the old dbd_db_login. [I'll happily discuss
what's required with the authors in a different thread.]

I'm checking in a change to the take_imp_data logic that
clarifies some things (but doesn't use the old imp_data
parameter to get dbi_imp_data).

Tim.

Reply via email to