BUG #2330: ECPGlib: Wrong error code in case of a duplicate key violation - Mailing list pgsql-bugs

From Michael Wolff
Subject BUG #2330: ECPGlib: Wrong error code in case of a duplicate key violation
Date
Msg-id 200603170836.k2H8aNeG000447@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #2330: ECPGlib: Wrong error code in case of a duplicate key violation  (Michael Meskes <meskes@postgresql.org>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: "Vinod Bapure"
Date:
Subject: BUG #2329: Sigmentation fault in SQLExec
Next
From: Tom Lane
Date:
Subject: Re: BUG #2327: Startup script for FC4 with selinux