r87332 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87331‎ | r87332 | r87333 >
Date:16:08, 3 May 2011
Author:reedy
Status:ok
Tags:
Comment:
MFT r87278
Modified paths:
  • /branches/REL1_17/phase3 (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/MysqlInstaller.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/includes/installer/MysqlInstaller.php
@@ -419,10 +419,6 @@
420420 }
421421
422422 public function setupUser() {
423 - if ( !$this->getVar( '_CreateDBAccount' ) ) {
424 - return Status::newGood();
425 - }
426 -
427423 $status = $this->getConnection();
428424 if ( !$status->isOK() ) {
429425 return $status;
@@ -436,21 +432,26 @@
437433 $password = $this->getVar( 'wgDBpassword' );
438434 $grantableNames = array();
439435
440 - // Before we blindly try to create a user that already has access,
441 - try { // first attempt to connect to the database
442 - new DatabaseMysql(
443 - $server,
444 - $dbUser,
445 - $password,
446 - false,
447 - false,
448 - 0,
449 - $this->getVar( 'wgDBprefix' )
450 - );
 436+ if ( $this->getVar( '_CreateDBAccount' ) ) {
 437+ // Before we blindly try to create a user that already has access,
 438+ try { // first attempt to connect to the database
 439+ new DatabaseMysql(
 440+ $server,
 441+ $dbUser,
 442+ $password,
 443+ false,
 444+ false,
 445+ 0,
 446+ $this->getVar( 'wgDBprefix' )
 447+ );
 448+ $grantableNames[] = $this->buildFullUserName( $dbUser, $server );
 449+ $tryToCreate = false;
 450+ } catch ( DBConnectionError $e ) {
 451+ $tryToCreate = true;
 452+ }
 453+ } else {
451454 $grantableNames[] = $this->buildFullUserName( $dbUser, $server );
452455 $tryToCreate = false;
453 - } catch ( DBConnectionError $e ) {
454 - $tryToCreate = true;
455456 }
456457
457458 if( $tryToCreate ) {
Property changes on: branches/REL1_17/phase3
___________________________________________________________________
Modified: svn:mergeinfo
458459 Merged /trunk/phase3:r87278

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87278(bug 28375) When using existing DB user, grants aren't added to new tablesdemon18:54, 2 May 2011

Status & tagging log