On Wed, 24 Sep 2003, Tim Bunce wrote:

> 
> On Tue, Sep 23, 2003 at 08:39:34PM +0100, Tony Bowden wrote:
> > On Tue, Sep 23, 2003 at 11:56:26AM +0000, Dominic Mitchell wrote:
> > > However, when you attempt to access one of the non-PK columns, it blows
> > > up:
> > >     print $pref->value, "\n";
> > >     # dies with:
> > >     # Can't select for 5502/foo using 'SELECT value
> > >     # FROM   account_preference
> > >     # WHERE  acc_id=? AND name=?
> > >     # ': Not an array reference (Account=HASH(0x8c43bf0)) at ...
> > 
> > Yick.
> > 

Hun?

> > As discovered from talking to Dominic off list, it seems that DBD::Pg
> > doesn't like being given overloaded objects as placeholder values:
> 
> That's a bug in the driver. May affect other drivers so I've cc'd
> this to [EMAIL PROTECTED]

DBD::Pg checks that what you are binding is not a reference and does not 
let you bind it -- I assume so you don't accidently bind a reference 
variable.  The problem is that an object with an overloaded stringify 
looks like a reference.  Commenting out the check lets the SV fall 
through to the SvPV and everthing works as it should.

I can't seem to think of a way to keep this check and get the overloaded
stringify to work... This is probably due to my lack of understaing of how
overload works.  I am assuming that there is magic on the variable and I
could do a mg_get if it is Magical, and then if SvPOK skip the refrence
check, but that does not seem to work?

Rudy.

Reply via email to