mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Started to create different error codes for different backend messages.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.11 2003/07/08 07:13:48 meskes Exp $ */
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.12 2003/07/15 12:38:38 meskes Exp $ */
|
||||
|
||||
#define POSTGRES_ECPG_INTERNAL
|
||||
#include "postgres_fe.h"
|
||||
@ -68,7 +68,6 @@ ecpg_finish(struct connection * act)
|
||||
struct ECPGtype_information_cache *cache,
|
||||
*ptr;
|
||||
|
||||
ECPGlog("ecpg_finish: finishing %s.\n", act->name);
|
||||
PQfinish(act->connection);
|
||||
|
||||
/* no need to lock connections_mutex - we're always called
|
||||
@ -90,6 +89,8 @@ ecpg_finish(struct connection * act)
|
||||
if (actual_connection == act)
|
||||
actual_connection = all_connections;
|
||||
|
||||
ECPGlog("ecpg_finish: Connection %s closed.\n", act->name);
|
||||
|
||||
for (cache = act->cache_head; cache; ptr = cache, cache = cache->next, ECPGfree(ptr));
|
||||
ECPGfree(act->name);
|
||||
ECPGfree(act);
|
||||
@ -481,10 +482,9 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
|
||||
|
||||
if (PQstatus(this->connection) == CONNECTION_BAD)
|
||||
{
|
||||
const char *errmsg = PQerrorMessage(this->connection);
|
||||
char *db = realname ? realname : "<DEFAULT>";
|
||||
const char *errmsg = PQerrorMessage(this->connection);
|
||||
char *db = realname ? realname : "<DEFAULT>";
|
||||
|
||||
set_backend_err(errmsg, lineno);
|
||||
ecpg_finish(this);
|
||||
#ifdef USE_THREADS
|
||||
pthread_mutex_unlock(&connections_mutex);
|
||||
|
Reference in New Issue
Block a user