http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84497
Revision: 84497
Author: greg
Date: 2011-03-21 22:09:49 +0000 (Mon, 21 Mar 2011)
Log Message:
-----------
When switching from admin to non-admin account, make sure to set $this->db to
null, otherwise MW will happily return the old handle, which means we end up in
the old admin database, and thus create our 'mediawiki' schema in the postgres
or template1 database (whoops!). There may be other similar cases in the code
in which we are not clearing this->db before toggling the useAdmin attribute.
Fixes bug 28171.
Modified Paths:
--------------
trunk/phase3/includes/installer/PostgresInstaller.php
Modified: trunk/phase3/includes/installer/PostgresInstaller.php
===================================================================
--- trunk/phase3/includes/installer/PostgresInstaller.php 2011-03-21
22:07:40 UTC (rev 84496)
+++ trunk/phase3/includes/installer/PostgresInstaller.php 2011-03-21
22:09:49 UTC (rev 84497)
@@ -231,11 +231,14 @@
$conn->query( "ALTER DATABASE $safedb OWNER TO
$safeuser", __METHOD__ );
}
+ // Now that we've established the real database exists, connect
to it
+ // Because we do not want the same connection, forcibly expire
the existing conn
+ $this->db = null;
$this->useAdmin = false;
- $status = $this->getConnection();
- if ( !$status->isOK() ) {
- return $status;
- }
+ $status = $this->getConnection();
+ if ( !$status->isOK() ) {
+ return $status;
+ }
$conn = $status->value;
if( !$conn->schemaExists( $schema ) ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs