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; }
done.
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.]
sure, i was planning to involve the authors when we have a polished code.
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).
Great, moving along, the next problem is
DBIc_FLAGS(imp) = DBIc_FLAGS(p_imp_xxh) & ~DBIcf_INHERITMASK;
killing the previously set DBIcf_IMPSET|DBIcf_ACTIVE) flags. I've tried to fix that as follows:
Index: DBI.xs
===================================================================
--- DBI.xs (revision 943)
+++ DBI.xs (working copy)
@@ -934,10 +934,13 @@
DBIc_set(imp, DBIcf_PrintWarn, PL_dowarn); /* set if warnings enabled
*/
}
else {
+ int flags = DBIc_FLAGS(imp);
DBIc_PARENT_H(imp) = (SV*)SvREFCNT_inc(p_h); /* ensure it lives
*/
DBIc_PARENT_COM(imp) = p_imp_xxh; /* shortcut for speed
*/
DBIc_TYPE(imp) = DBIc_TYPE(p_imp_xxh) + 1;
+ /* XXX: kills the DBIcf_IMPSET flag */
DBIc_FLAGS(imp) = DBIc_FLAGS(p_imp_xxh) & ~DBIcf_INHERITMASK;
+ DBIc_FLAGS(imp) |= flags & (DBIcf_IMPSET|DBIcf_ACTIVE);
++DBIc_KIDS(p_imp_xxh);
}
#ifdef DBI_USE_THREADSand it works fine for connection skip, but I now get:
panic: DBI active kids (-1) < 0 or > kids (1) at t/70takeimp.t line 121.
(in cleanup) panic: DBI active kids (-2) < 0 or > kids (1).
DBI handle 0x81fd85c cleared whilst still active.
DBI handle 0x81fd85c has uncleared implementors data.
dbih_clearcom (dbh 0x81fd85c, com 0x820ccb0, imp DBD::mysql::db):
FLAGS 0x180317: COMSET IMPSET Active Warn PrintError PrintWarn AutoCommit
PARENT DBI::dr=HASH(0x81d7974)
KIDS 0 (0 Active)
IMP_DATA HASH(0x81ff73c)
-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
