mirror of
https://github.com/postgres/postgres.git
synced 2025-05-17 06:41:24 +03:00
Fixed bug 2330: Wrong error code in case of a duplicate key
This commit is contained in:
parent
efef460028
commit
ac2c2a457f
@ -1,4 +1,4 @@
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.9 2003/08/25 13:43:58 meskes Exp $ */
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.9.2.1 2006/03/19 12:32:13 meskes Exp $ */
|
||||
|
||||
#define POSTGRES_ECPG_INTERNAL
|
||||
#include "postgres_fe.h"
|
||||
@ -186,7 +186,7 @@ ECPGraise_backend(int line, PGresult *result, PGconn *conn, int compat)
|
||||
/* assign SQLCODE for backward compatibility */
|
||||
if (strncmp(sqlca->sqlstate, "23505", sizeof(sqlca->sqlstate)) == 0)
|
||||
sqlca->sqlcode = INFORMIX_MODE(compat) ? ECPG_INFORMIX_DUPLICATE_KEY : ECPG_DUPLICATE_KEY;
|
||||
if (strncmp(sqlca->sqlstate, "21000", sizeof(sqlca->sqlstate)) == 0)
|
||||
else if (strncmp(sqlca->sqlstate, "21000", sizeof(sqlca->sqlstate)) == 0)
|
||||
sqlca->sqlcode = INFORMIX_MODE(compat) ? ECPG_INFORMIX_SUBSELECT_NOT_ONE : ECPG_SUBSELECT_NOT_ONE;
|
||||
else
|
||||
sqlca->sqlcode = ECPG_PGSQL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user