Commit 6e2cf34e authored by Michael Meskes's avatar Michael Meskes

Better test the content of the SQLSTATE string in ecpglib than the pointer.

parent 2a0dec78
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.24 2010/03/05 13:57:08 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.25 2010/03/08 12:15:24 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL #define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -306,7 +306,7 @@ ecpg_raise_backend(int line, PGresult *result, PGconn *conn, int compat) ...@@ -306,7 +306,7 @@ ecpg_raise_backend(int line, PGresult *result, PGconn *conn, int compat)
message = PQerrorMessage(conn); message = PQerrorMessage(conn);
} }
if (sqlstate == ECPG_SQLSTATE_ECPG_INTERNAL_ERROR) if (strcmp(sqlstate, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR) == 0)
{ {
/* we might get here if the connection breaks down, so let's /* we might get here if the connection breaks down, so let's
* check for this instead of giving just the generic internal error */ * check for this instead of giving just the generic internal error */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment