Force new connection to database, fixes bug 20475, might have unforseen consequences
authorOverlordQ <overlordq@users.mediawiki.org>
Fri, 5 Feb 2010 05:40:50 +0000 (05:40 +0000)
committerOverlordQ <overlordq@users.mediawiki.org>
Fri, 5 Feb 2010 05:40:50 +0000 (05:40 +0000)
includes/db/DatabasePostgres.php

index 9a834ba..e76e70a 100644 (file)
@@ -136,8 +136,8 @@ class DatabasePostgres extends DatabaseBase {
 
                global $wgDBport;
 
-               if (!strlen($user)) { ## e.g. the class is being loaded  
-                       return;  
+               if (!strlen($user)) { ## e.g. the class is being loaded
+                       return;
                }
                $this->close();
                $this->mServer = $server;
@@ -156,7 +156,7 @@ class DatabasePostgres extends DatabaseBase {
                if ($port!=false && $port!="") {
                        $connectVars['port'] = $port;
                }
-               $connectString = $this->makeConnectionString( $connectVars );
+               $connectString = $this->makeConnectionString( $connectVars, PGSQL_CONNECT_FORCE_NEW );
 
                $this->installErrorHandler();
                $this->mConn = pg_connect( $connectString );