I've no time to dig, but this works:

$ perl -MDBI -wl -e 'print
DBI->connect("dbi:Sponge:",undef,undef,{dbi_imp_data=>42})->{dbi_imp_data}'
42

Tim.

On Mon, Mar 28, 2005 at 05:09:21PM -0500, Stas Bekman wrote:
> Stas Bekman wrote:
> 
> Tim, connect() never uses "dbi_imp_data" attribute
> 
> in DBI.pm: sub _new_handle it lives in: $i->{Database}->'dbi_imp_data'
> 
> $i = tie %hash, $class, $attr;
> {
>     'FetchHashKeyName' => 'NAME',
>     'TraceLevel' => 0,
>     'Database' => bless( {
>                           'FetchHashKeyName' => 'NAME',
>                           'TraceLevel' => 0,
>                           'dbi_imp_data' => '...',
>                           'ImplementorClass' => 'DBD::mysql::db',
> 
> but dbih_setup_handle doesn't get to see it:
> 
> dbih_setup_handle(SV *orv, char *imp_class, SV *parent, SV *imp_datasv)
> [...]
>     if (parent) {
>       parent_imp = DBIh_COM(parent);
>       if (DBIc_TYPE(parent_imp) == DBIt_DR && (svp = 
>       hv_fetch((HV*)SvRV(h), "dbi_imp_data", 12, 0))) {
>           dbi_imp_data = *svp;
>       }
>     }
>     else {
>       parent_imp = NULL;
>     }
> 
> i.e. hv_fetch((HV*)SvRV(h), "dbi_imp_data", 12, 0))) never sees 
> dbi_imp_data.
> 
> Something is missing. Ideas?
> 
> -- 
> __________________________________________________________________
> 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

Reply via email to