OK, I have applied the following patch. The fix will appear in the next
release if DBDpg.

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

Kai wrote:
> On Tue, Dec 17, 2002 at 11:16:59PM -0500, Bruce Momjian wrote:
> > 
> > Would you re-send me the other email that had the script.
> > 
> 
> Hi Bruce,
> 
> Did you have any luck with the buglet below?
> 
> Attached is my patch for DBD-Pg-1.20, dbdimp.c, which fixes the problem, but
> I'm completely in the dark about any memory leaks I could have introduced,
> nor am I allknowing about any unknown behaviour ;-).
> 
> I have tested it with the scripts I sent you earlier, and the return of the
> commit is now FALSE when thec ommit fails, and the error is stored correctly
> in $dbh->errstr().
> 
> Regards (and a happy new year),
> 
> > Kai wrote:
> > > Hello all,
> > > 
> > > After some investigation of DBI's code, and DBD-Pg I came to the conclusion
> > > that errors from the SQL backend are not reported back to the DBD, and DBD
> > > only reports 'commit failed\n', not the actual error from the SQL backend.
> > > This behaviour seems to be the same for DBD-Oracle and DBD-Sybase.
> > > 
> > > Secondly if the DBI's connection was in a Non-AutoCommit mode, the
> > > database-state was left without issuing a BEGIN after the failed COMMIT.
> > > Again, this seemed to be missing in the above DBD implementations.
> > > 
> > > [ this is tested against DBI-1.32 and DBD-Pg-1.20 ]
> > > 
> > > Now I'm wondering if this behaviour is normal. It seems wrong to me at
> > > least, but it could be ill logic on my side :-/.
> > > 
> > > 
> > > I have attached a postgresql create table script, some plain SQL queries,
> > > and a perlscript doing that same queries via DBD::Pg to show a reproducable
> > > commit-error in postgresql. (I have no Oracle at hand, nor Sybase, though I
> > > know that Sybase does the same tricks with triggers invoking at commit).
> > > 
> > > Interesting output in the script:
> > > DBD::Pg::db commit failed: commit failed at dbh-test.pl line 52.
> > > and:
> > > NOTICE:  COMMIT: no transaction in progress
> > > 
> > > Further along; I could send in a patch for DBD-Pg, but I'm no freak with
> > > memory leaks etc...
> > > 
> > > Thanks for any enlightenment,
> 
> -- 
> Kai
> 
> 96 pings make up a single Bong (Peter Salus)

[ Attachment, skipping... ]

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

Reply via email to