iliaa           Tue Dec  4 13:03:26 2007 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/pdo_pgsql      pgsql_driver.c 
  Log:
  
  Fixed bug #43493 (pdo_pgsql does not send username on connect when password
  is not available)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.53.2.14.2.9.2.1&r2=1.53.2.14.2.9.2.2&diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_driver.c
diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14.2.9.2.1 
php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14.2.9.2.2
--- php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14.2.9.2.1      Thu Sep 27 
18:00:42 2007
+++ php-src/ext/pdo_pgsql/pgsql_driver.c        Tue Dec  4 13:03:26 2007
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pgsql_driver.c,v 1.53.2.14.2.9.2.1 2007/09/27 18:00:42 dmitry Exp $ */
+/* $Id: pgsql_driver.c,v 1.53.2.14.2.9.2.2 2007/12/04 13:03:26 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -692,14 +692,14 @@
        }
 
        /* 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);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to