On Tue, Aug 10, 2004 at 12:01:48PM +0200, Leandro C. Hermida wrote:
> Hello,
> 
> I am not sure if this is a bug but I have used DBI and DBD::Oracle
> for a long time without any probllem and I am almost certain that
> something might be wrong.  Both modules are awesome and this is the
> first time that I have ever seen any unexpected behavior.  The issue:
> 
> 1) if I set $dbh->{LongReadLen} = 1000;
> 2) then I do my $sth = $dbh->prepare_cached('SELECT my_clob FROM table');
> ...
> 3) then after a while I change $dbh->{LongReadLen} = 5000;
> 4) and then I call the same old statement
>    my $sth = $dbh->prepare_cached('SELECT my_clob FROM table');
> 
> Sometimes the $sth I get back was not prepared with the new 5000 LongReadLen
> but the old 1000 LongReadLen.  It checked out because after doing step 4
> I looked at $sth->{LongReadLen} and it was equal to 1000.  Its like the
> prepare_cached is not inheriting the \%attr it needs for the $sth from the $dbh.

A feature not a bug. See the DBI docs for how prepare_cached acts.

> From the documentation it says that prepare_cached will
> return the old cached $sth if the SQL statement and \%attr are exactly the
> same.  Is there a bug with prepare_cached not inheriting \%attr from
> the $dbh to the $sth?

The \%attr refers to the \%attr parameter of prepare_cached and not to
the current attribute settings of the handle. I'll clarify the docs.

Tim.

Reply via email to