aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2010-05-07 19:35:03 +0000
committerMichael Meskes <meskes@postgresql.org>2010-05-07 19:35:03 +0000
commit71a185a24d573dc1449777ff9fa8f3020af6f13c (patch)
treeb58afbb2bf568e70340299da5b09ceffed9f8a9a
parentcd86869a9a56715a4143aff460f58ad9b4750475 (diff)
downloadpostgresql-71a185a24d573dc1449777ff9fa8f3020af6f13c.tar.gz
postgresql-71a185a24d573dc1449777ff9fa8f3020af6f13c.zip
ECPG connect routine only checked for NULL to find empty parameters, but user and password can also be "".
-rw-r--r--src/interfaces/ecpg/ecpglib/connect.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c
index 425da775a0c..a124a894957 100644
--- a/src/interfaces/ecpg/ecpglib/connect.c
+++ b/src/interfaces/ecpg/ecpglib/connect.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.54 2009/06/11 14:49:13 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.55 2010/05/07 19:35:03 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -475,7 +475,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
host ? host : "<DEFAULT>",
port ? (ecpg_internal_regression_mode ? "<REGRESSION_PORT>" : port) : "<DEFAULT>",
options ? "with options " : "", options ? options : "",
- user ? "for user " : "", user ? user : "");
+ (user && strlen(user) > 0) ? "for user " : "", user ? user : "");
connect_string = ecpg_alloc(strlen_or_null(host)
+ strlen_or_null(port)
@@ -494,8 +494,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
realname ? "dbname=" : "", realname ? realname : "",
host ? "host=" : "", host ? host : "",
port ? "port=" : "", port ? port : "",
- user ? "user=" : "", user ? user : "",
- passwd ? "password=" : "", passwd ? passwd : "",
+ (user && strlen(user) > 0) ? "user=" : "", user ? user : "",
+ (passwd && strlen(passwd) > 0) ? "password=" : "", passwd ? passwd : "",
options ? options : "");
/*