Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0941a89

Browse files
author
Michael Meskes
committed
Fixed bug 2330: Wrong error code in case of a duplicate key
1 parent 92f5bfc commit 0941a89

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/interfaces/ecpg/ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,10 @@ Tu Feb 7 18:48:14 CET 2006
19931993

19941994
- Bit field notation belongs to a variable not a variable list.
19951995
- Output of line number only done by one function.
1996+
1997+
Fri, 17 Mar 2006 16:38:19 +0100
1998+
1999+
- Fixed bug 2330: Wrong error code in case of a duplicate key
19962000
- Set ecpg library version to 5.2.
19972001
- Set ecpg version to 4.2.1.
19982002

src/interfaces/ecpg/ecpglib/error.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.11 2005/10/15 02:49:47 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.12 2006/03/17 15:46:13 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -186,7 +186,7 @@ ECPGraise_backend(int line, PGresult *result, PGconn *conn, int compat)
186186
/* assign SQLCODE for backward compatibility */
187187
if (strncmp(sqlca->sqlstate, "23505", sizeof(sqlca->sqlstate)) == 0)
188188
sqlca->sqlcode = INFORMIX_MODE(compat) ? ECPG_INFORMIX_DUPLICATE_KEY : ECPG_DUPLICATE_KEY;
189-
if (strncmp(sqlca->sqlstate, "21000", sizeof(sqlca->sqlstate)) == 0)
189+
else if (strncmp(sqlca->sqlstate, "21000", sizeof(sqlca->sqlstate)) == 0)
190190
sqlca->sqlcode = INFORMIX_MODE(compat) ? ECPG_INFORMIX_SUBSELECT_NOT_ONE : ECPG_SUBSELECT_NOT_ONE;
191191
else
192192
sqlca->sqlcode = ECPG_PGSQL;

0 commit comments

Comments
 (0)