1
- /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.50 2008/03/27 07:56:00 meskes Exp $ */
1
+ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.51 2008/05/16 15:20:03 petere Exp $ */
2
2
3
3
#define POSTGRES_ECPG_INTERNAL
4
4
#include "postgres_fe.h"
@@ -144,14 +144,14 @@ ecpg_finish(struct connection * act)
144
144
if (actual_connection == act )
145
145
actual_connection = all_connections ;
146
146
147
- ecpg_log ("ecpg_finish: Connection %s closed. \n" , act -> name );
147
+ ecpg_log ("ecpg_finish: connection %s closed\n" , act -> name );
148
148
149
149
for (cache = act -> cache_head ; cache ; ptr = cache , cache = cache -> next , ecpg_free (ptr ));
150
150
ecpg_free (act -> name );
151
151
ecpg_free (act );
152
152
}
153
153
else
154
- ecpg_log ("ecpg_finish: called an extra time. \n" );
154
+ ecpg_log ("ecpg_finish: called an extra time\n" );
155
155
}
156
156
157
157
bool
@@ -163,7 +163,7 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
163
163
if (!ecpg_init (con , connection_name , lineno ))
164
164
return (false);
165
165
166
- ecpg_log ("ECPGsetcommit line %d action = %s connection = %s \n" , lineno , mode , con -> name );
166
+ ecpg_log ("ECPGsetcommit on line %d: action \"%s\"; connection \"%s\" \n" , lineno , mode , con -> name );
167
167
168
168
if (con -> autocommit == true && strncmp (mode , "off" , strlen ("off" )) == 0 )
169
169
{
@@ -223,13 +223,13 @@ ECPGnoticeReceiver(void *arg, const PGresult *result)
223
223
sqlstate = ECPG_SQLSTATE_ECPG_INTERNAL_ERROR ;
224
224
225
225
if (message == NULL ) /* Shouldn't happen, but need to be sure */
226
- message = "No message received" ;
226
+ message = _ ( "No message received" ) ;
227
227
228
228
/* these are not warnings */
229
229
if (strncmp (sqlstate , "00" , 2 ) == 0 )
230
230
return ;
231
231
232
- ecpg_log ("ECPGnoticeReceiver %s\n" , message );
232
+ ecpg_log ("ECPGnoticeReceiver: %s\n" , message );
233
233
234
234
/* map to SQLCODE for backward compatibility */
235
235
if (strcmp (sqlstate , ECPG_SQLSTATE_INVALID_CURSOR_NAME ) == 0 )
@@ -377,8 +377,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
377
377
host = ecpg_strdup (tmp + 1 , lineno );
378
378
if (strncmp (dbname , "unix:" , 5 ) != 0 )
379
379
{
380
- ecpg_log ("ECPGconnect: socketname %s given for TCP connection in line %d\n" , host , lineno );
381
- ecpg_raise (lineno , ECPG_CONNECT , ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION , realname ? realname : "<DEFAULT>" );
380
+ ecpg_log ("ECPGconnect: socketname %s given for TCP connection on line %d\n" , host , lineno );
381
+ ecpg_raise (lineno , ECPG_CONNECT , ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION , realname ? realname : _ ( "<DEFAULT>" ) );
382
382
if (host )
383
383
ecpg_free (host );
384
384
@@ -403,8 +403,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
403
403
{
404
404
if (strcmp (dbname + offset , "localhost" ) != 0 && strcmp (dbname + offset , "127.0.0.1" ) != 0 )
405
405
{
406
- ecpg_log ("ECPGconnect: non-localhost access via sockets in line %d\n" , lineno );
407
- ecpg_raise (lineno , ECPG_CONNECT , ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION , realname ? realname : "<DEFAULT>" );
406
+ ecpg_log ("ECPGconnect: non-localhost access via sockets on line %d\n" , lineno );
407
+ ecpg_raise (lineno , ECPG_CONNECT , ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION , realname ? realname : _ ( "<DEFAULT>" ) );
408
408
if (host )
409
409
ecpg_free (host );
410
410
if (port )
@@ -471,11 +471,11 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
471
471
actual_connection = all_connections ;
472
472
473
473
ecpg_log ("ECPGconnect: opening database %s on %s port %s %s%s %s%s\n" ,
474
- realname ? realname : "<DEFAULT>" ,
475
- host ? host : "<DEFAULT>" ,
476
- port ? (ecpg_internal_regression_mode ? "<REGRESSION_PORT>" : port ) : "<DEFAULT>" ,
477
- options ? "with options " : "" , options ? options : "" ,
478
- user ? "for user " : "" , user ? user : "" );
474
+ realname ? realname : _ ( "<DEFAULT>" ) ,
475
+ host ? host : _ ( "<DEFAULT>" ) ,
476
+ port ? (ecpg_internal_regression_mode ? _ ( "<REGRESSION_PORT>" ) : port ) : _ ( "<DEFAULT>" ) ,
477
+ options ? _ ( "with options " ) : "" , options ? options : "" ,
478
+ user ? _ ( "for user " ) : "" , user ? user : "" );
479
479
480
480
connect_string = ecpg_alloc ( strlen_or_null (host )
481
481
+ strlen_or_null (port )
@@ -515,7 +515,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
515
515
if (PQstatus (this -> connection ) == CONNECTION_BAD )
516
516
{
517
517
const char * errmsg = PQerrorMessage (this -> connection );
518
- const char * db = realname ? realname : "<DEFAULT>" ;
518
+ const char * db = realname ? realname : _ ( "<DEFAULT>" ) ;
519
519
520
520
ecpg_log ("ECPGconnect: could not open database: %s\n" , errmsg );
521
521
0 commit comments