Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Dominic Mitchell <dom(at)semantico(dot)com>
Cc: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>, Rudy Lippan <rlippan(at)remotelinux(dot)com>, David Wheeler <david(at)wheeler(dot)net>, pgsql-interfaces(at)postgresql(dot)org, "'DBI developers'" <dbi-dev(at)perl(dot)org>
Subject: Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
Date: 2003-07-08 22:40:49
Message-ID: 200307082240.h68MenT06234@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces


I meant to say "Already applied by someone else --- not me".

---------------------------------------------------------------------------

Dominic Mitchell wrote:
> Tim Bunce wrote:
> > Ah, you're passing it the address of (probably temporary) reference.
> > It's the underlying object (which the ref points to) that you need.
> >
> > Try something like:
> >
> > PQsetNoticeProcessor(imp_dbh->conn, pg_warn, (void *)SvRV(dbh));
> >
> > the D_imp_dbh( (SV *)arg ) will do-the-right-thing *if* the
> > handle is the 'last handle used' ($DBI::lasth) whenever it's called.
> >
> > That's probably not a safe assumption so you could try something
> > more like this:
> >
> > D_imp_dbh( sv_2mortal(newRV((SV*)arg)) );
>
> Thank you! This worked a treat. It turned out that sv_2mortal() was
> necessary after all. I'm going to go away and read up on XS before I
> try this sort of thing again, I think.
>
> Could somebody with a commit bit for dbdpg please apply the attached
> patch? It passes all tests here on perl 5.8.0 / postgres 7.3.2. I
> don't think that it will cause any problems for other perl versions...

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Browse pgsql-interfaces by date

  From Date Subject
Next Message Adam Pigg 2003-07-09 20:30:07 libpq:Find Table Name
Previous Message Bruce Momjian 2003-07-08 22:38:51 Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)