BUG #2330: ECPGlib: Wrong error code in case of a duplicate key violation

Started by Michael Wolffabout 20 years ago4 messagesbugs
Jump to latest
#1Michael Wolff
mwolff@cosa.de

The following bug has been logged online:

Bug reference: 2330
Logged by: Michael Wolff
Email address: mwolff@cosa.de
PostgreSQL version: 8.1.2 & 8.1.3
Operating system: Linux
Description: ECPGlib: Wrong error code in case of a duplicate key
violation
Details:

I figured out an error in the file src/interfaces/ecpg/ecpglib/error.c CVS
version 1.11 in line 189:

The if statement has been preceeded by an else.

original code:
if (strncmp(sqlca->sqlstate, "21000", sizeof(sqlca->sqlstate)) == 0)

fixed code:
else if (strncmp(sqlca->sqlstate, "21000", sizeof(sqlca->sqlstate)) == 0)

Regards,
Michael

#2Michael Meskes
meskes@postgresql.org
In reply to: Michael Wolff (#1)
Re: BUG #2330: ECPGlib: Wrong error code in case of a duplicate key violation

Am Freitag, 17. März 2006 09:36 schrieb Michael Wolff:

The following bug has been logged online:
...
Description: ECPGlib: Wrong error code in case of a duplicate key

Just fixed in CVS HEAD. Thanks for your report.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Meskes (#2)
Re: BUG #2330: ECPGlib: Wrong error code in case of a duplicate key violation

Michael Meskes <meskes@postgresql.org> writes:

Am Freitag, 17. März 2006 09:36 schrieb Michael Wolff:

Description: ECPGlib: Wrong error code in case of a duplicate key

Just fixed in CVS HEAD. Thanks for your report.

Wouldn't it be a good idea to back-patch this? At least as far as
8.1.*?

regards, tom lane

#4Michael Meskes
meskes@postgresql.org
In reply to: Tom Lane (#3)
Re: BUG #2330: ECPGlib: Wrong error code in case of a duplicate key violation

Description: ECPGlib: Wrong error code in case of a duplicate key

Just fixed in CVS HEAD. Thanks for your report.

Wouldn't it be a good idea to back-patch this? At least as far as
8.1.*?

Indeed it is. Sorry, was in a hurry. Since it's such a small patch I also
committed it to 7.4, 8.0 and 8.1.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!