mirror of
https://github.com/postgres/postgres.git
synced 2025-06-01 00:01:20 -04:00
Fixed bug 2330: Wrong error code in case of a duplicate key
This commit is contained in:
parent
a9f18b97ba
commit
85fa81f65b
@ -1,4 +1,4 @@
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.11 2005/10/15 02:49:47 momjian Exp $ */
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.11.2.1 2006/03/19 12:29:40 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