summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql/pgsql_driver.c
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:39:08 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:39:08 -0400
commit993e1866df547532a05ab6db76c9ff5aefc9a3df (patch)
tree169d3bde0974235d3cde164786ef6f381a4749a7 /ext/pdo_pgsql/pgsql_driver.c
parent1f589a2bd44ba835ad1b009a5d83abd453724829 (diff)
downloadphp-993e1866df547532a05ab6db76c9ff5aefc9a3df.tar.gz
Imported Upstream version 5.2.6upstream/5.2.6
Diffstat (limited to 'ext/pdo_pgsql/pgsql_driver.c')
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index bcd510558..82d141522 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2007 The PHP Group |
+ | Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql_driver.c,v 1.53.2.14.2.9 2007/06/28 03:13:29 iliaa Exp $ */
+/* $Id: pgsql_driver.c,v 1.53.2.14.2.11 2007/12/31 07:20:10 sebastian Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -692,14 +692,14 @@ static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
/* support both full connection string & connection string + login and/or password */
- if (!dbh->username || !dbh->password) {
- spprintf(&conn_str, 0, "%s connect_timeout=%ld", (char *) dbh->data_source, connect_timeout);
- } else if (dbh->username && dbh->password) {
+ if (dbh->username && dbh->password) {
spprintf(&conn_str, 0, "%s user=%s password=%s connect_timeout=%ld", dbh->data_source, dbh->username, dbh->password, connect_timeout);
} else if (dbh->username) {
spprintf(&conn_str, 0, "%s user=%s connect_timeout=%ld", dbh->data_source, dbh->username, connect_timeout);
- } else {
+ } else if (dbh->password) {
spprintf(&conn_str, 0, "%s password=%s connect_timeout=%ld", dbh->data_source, dbh->password, connect_timeout);
+ } else {
+ spprintf(&conn_str, 0, "%s connect_timeout=%ld", (char *) dbh->data_source, connect_timeout);
}
H->server = PQconnectdb(conn_str);