Skip to content
Snippets Groups Projects
Commit 71a185a2 authored by Michael Meskes's avatar Michael Meskes
Browse files

ECPG connect routine only checked for NULL to find empty parameters, but user...

ECPG connect routine only checked for NULL to find empty parameters, but user and password can also be "".
parent cd86869a
No related branches found
No related tags found
No related merge requests found
/* $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 : "");
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment