psqlodbc.git / summary / log / commit / refs

commit    34bbcf2f91d9728f64c11dd0ccfccba8fffd2a96
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Thu Apr 18 19:26:33 2013 +0000

    If one of 'Database', 'Port', or 'Servername' is missing, make error message
    more specific.


connection.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/connection.c b/connection.c index 0f56ffc6..288b9145 100644 --- a/connection.c +++ b/connection.c @@ -1351,13 +1351,22 @@ static char CC_initial_log(ConnectionClass *self, const char *func) mylog("%s: DSN = '%s', server = '%s', port = '%s', database = '%s', username = '%s', password='%s'\n", func, ci->dsn, ci->server, ci->port, ci->database, ci->username, ci->password ? "xxxxx" : ""); - if (ci->port[0] == '\0' || + if (ci->port[0] == '\0') + { + CC_set_error(self, CONN_INIREAD_ERROR, "Missing port in call to CC_connect.", func); + return 0; + + } #ifdef WIN32 - ci->server[0] == '\0' || + if (ci->server[0] == '\0') + { + CC_set_error(self, CONN_INIREAD_ERROR, "Missing server name in call to CC_connect.", func); + return 0; + } #endif /* WIN32 */ - ci->database[0] == '\0') + if (ci->database[0] == '\0') { - CC_set_error(self, CONN_INIREAD_ERROR, "Missing server name, port, or database name in call to CC_connect.", func); + CC_set_error(self, CONN_INIREAD_ERROR, "Missing database name in call to CC_connect.", func); return 0; } [parent: ef58f1c0ddce]