r85081 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85080‎ | r85081 | r85082 >
Date:19:33, 31 March 2011
Author:demon
Status:resolved (Comments)
Tags:
Comment:
MFT last round of db and installer changes: r81755, r82596, r85021, r85047, r85066
Modified paths:
  • /branches/REL1_17/phase3/includes/db/Database.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/DatabaseInstaller.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/DatabaseUpdater.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/OracleUpdater.php (modified) (history)
  • /branches/REL1_17/phase3/includes/installer/WebInstallerPage.php (modified) (history)
  • /branches/REL1_17/phase3/maintenance/update.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/maintenance/update.php
@@ -87,10 +87,14 @@
8888 }
8989
9090 $shared = $this->hasOption( 'doshared' );
91 - $purge = !$this->hasOption( 'nopurge' );
9291
 92+ $updates = array('core','extensions');
 93+ if( !$this->hasOption('nopurge') ) {
 94+ $updates[] = 'purge';
 95+ }
 96+
9397 $updater = DatabaseUpdater::newForDb( $db, $shared, $this );
94 - $updater->doUpdates( $purge );
 98+ $updater->doUpdates( $updates );
9599
96100 foreach( $updater->getPostDatabaseUpdateMaintenance() as $maint ) {
97101 $child = $this->runChild( $maint );
Property changes on: branches/REL1_17/phase3/maintenance/update.php
___________________________________________________________________
Added: svn:mergeinfo
98102 Merged /branches/sqlite/maintenance/update.php:r58211-58321
99103 Merged /trunk/phase3/maintenance/update.php:r79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81519,85047
100104 Merged /branches/new-installer/phase3/maintenance/update.php:r43664-66004
101105 Merged /branches/REL1_15/phase3/maintenance/update.php:r51646
Index: branches/REL1_17/phase3/includes/db/Database.php
@@ -737,7 +737,10 @@
738738 $sqlx = strtr( $sqlx, "\t\n", ' ' );
739739 global $wgRequestTime;
740740 $elapsed = round( microtime( true ) - $wgRequestTime, 3 );
741 - wfLogDBError( "Connection lost and reconnected after {$elapsed}s, query: $sqlx\n" );
 741+ if ( $elapsed < 300 ) {
 742+ # Not a database error to lose a transaction after a minute or two
 743+ wfLogDBError( "Connection lost and reconnected after {$elapsed}s, query: $sqlx\n" );
 744+ }
742745 $ret = $this->doQuery( $commentedSql );
743746 } else {
744747 wfDebug( "Failed\n" );
@@ -1625,7 +1628,7 @@
16261629 if ( !$alias || $alias == $name ) {
16271630 return $this->tableName( $name );
16281631 } else {
1629 - return $this->tableName( $name ) . ' ' . $this->addIdentifierQuotes( $alias );
 1632+ return $this->tableName( $name ) . ' ' . $this->addQuotes( $alias );
16301633 }
16311634 }
16321635
Property changes on: branches/REL1_17/phase3/includes/db/Database.php
___________________________________________________________________
Modified: svn:mergeinfo
16331636 Merged /branches/wmf/1.16wmf4/includes/db/Database.php:r67177
16341637 Merged /trunk/phase3/includes/db/Database.php:r81755,82596
Index: branches/REL1_17/phase3/includes/installer/DatabaseUpdater.php
@@ -189,21 +189,28 @@
190190 /**
191191 * Do all the updates
192192 *
193 - * @param $purge Boolean: whether to clear the objectcache table after updates
 193+ * @param $what Array: what updates to perform
194194 */
195 - public function doUpdates( $purge = true ) {
 195+ public function doUpdates( $what = array( 'core', 'extensions', 'purge' ) ) {
196196 global $wgVersion;
197197
198 - $this->runUpdates( $this->getCoreUpdateList(), false );
199 - $this->runUpdates( $this->getOldGlobalUpdates(), false );
200 - $this->runUpdates( $this->getExtensionUpdates(), true );
 198+ $what = array_flip( $what );
 199+ if ( isset( $what['core'] ) ) {
 200+ $this->runUpdates( $this->getCoreUpdateList(), false );
 201+ }
 202+ if ( isset( $what['extensions'] ) ) {
 203+ $this->runUpdates( $this->getOldGlobalUpdates(), false );
 204+ $this->runUpdates( $this->getExtensionUpdates(), true );
 205+ }
201206
202207 $this->setAppliedUpdates( $wgVersion, $this->updates );
203208
204 - if( $purge ) {
 209+ if( isset( $what['purge'] ) ) {
205210 $this->purgeCache();
206211 }
207 - $this->checkStats();
 212+ if ( isset( $what['core'] ) ) {
 213+ $this->checkStats();
 214+ }
208215 }
209216
210217 /**
Index: branches/REL1_17/phase3/includes/installer/OracleUpdater.php
@@ -83,8 +83,8 @@
8484 /**
8585 * Overload: after this action field info table has to be rebuilt
8686 */
87 - public function doUpdates( $purge = true ) {
88 - parent::doUpdates();
 87+ public function doUpdates( $what = array( 'core', 'extensions', 'purge' ) ) {
 88+ parent::doUpdates( $what );
8989
9090 $this->db->query( 'BEGIN fill_wiki_info; END;' );
9191 }
Index: branches/REL1_17/phase3/includes/installer/DatabaseInstaller.php
@@ -202,6 +202,10 @@
203203 }
204204 }
205205 }
 206+
 207+ // Now run updates to create tables for old extensions
 208+ $updater->doUpdates( array( 'extensions' ) );
 209+
206210 return $status;
207211 }
208212
Property changes on: branches/REL1_17/phase3/includes/installer/DatabaseInstaller.php
___________________________________________________________________
Modified: svn:mergeinfo
209213 Merged /trunk/phase3/includes/installer/DatabaseInstaller.php:r85021,85066
Index: branches/REL1_17/phase3/includes/installer/WebInstallerPage.php
@@ -114,6 +114,27 @@
115115 protected function getFieldsetEnd() {
116116 return "</fieldset>\n";
117117 }
 118+
 119+ /**
 120+ * Opens a textarea used to display the progress of a long operation
 121+ */
 122+ protected function startLiveBox() {
 123+ $this->addHTML(
 124+ '<div id="config-spinner" style="display:none;"><img src="../skins/common/images/ajax-loader.gif" /></div>' .
 125+ '<script>jQuery( "#config-spinner" ).show();</script>' .
 126+ '<textarea id="config-live-log" name="LiveLog" rows="10" cols="30" readonly="readonly">'
 127+ );
 128+ $this->parent->output->flush();
 129+ }
 130+
 131+ /**
 132+ * Opposite to startLiveBox()
 133+ */
 134+ protected function endLiveBox() {
 135+ $this->addHTML( '</textarea>
 136+<script>jQuery( "#config-spinner" ).hide()</script>' );
 137+ $this->parent->output->flush();
 138+ }
118139 }
119140
120141 class WebInstaller_Language extends WebInstallerPage {
@@ -464,16 +485,11 @@
465486
466487 if ( $this->parent->request->wasPosted() ) {
467488 $installer->preUpgrade();
468 - $this->addHTML(
469 - '<div id="config-spinner" style="display:none;"><img src="../skins/common/images/ajax-loader.gif" /></div>' .
470 - '<script>jQuery( "#config-spinner" )[0].style.display = "block";</script>' .
471 - '<textarea id="config-update-log" name="UpdateLog" rows="10" readonly="readonly">'
472 - );
473 - $this->parent->output->flush();
 489+
 490+ $this->startLiveBox();
474491 $result = $installer->doUpgrade();
475 - $this->addHTML( '</textarea>
476 -<script>jQuery( "#config-spinner" )[0].style.display = "none";</script>' );
477 - $this->parent->output->flush();
 492+ $this->endLiveBox();
 493+
478494 if ( $result ) {
479495 // If they're going to possibly regenerate LocalSettings, we
480496 // need to create the upgrade/secret keys. Bug 26481
@@ -1081,9 +1097,15 @@
10821098
10831099 public function startStage( $step ) {
10841100 $this->addHTML( "<li>" . wfMsgHtml( "config-install-$step" ) . wfMsg( 'ellipsis') );
 1101+ if ( $step == 'extension-tables' ) {
 1102+ $this->startLiveBox();
 1103+ }
10851104 }
10861105
10871106 public function endStage( $step, $status ) {
 1107+ if ( $step == 'extension-tables' ) {
 1108+ $this->endLiveBox();
 1109+ }
10881110 $msg = $status->isOk() ? 'config-install-step-done' : 'config-install-step-failed';
10891111 $html = wfMsgHtml( 'word-separator' ) . wfMsgHtml( $msg );
10901112 if ( !$status->isOk() ) {
Property changes on: branches/REL1_17/phase3/includes/installer/WebInstallerPage.php
___________________________________________________________________
Modified: svn:mergeinfo
10911113 Merged /trunk/phase3/includes/installer/WebInstallerPage.php:r85021,85066
Property changes on: branches/REL1_17/phase3/includes/installer
___________________________________________________________________
Modified: svn:mergeinfo
10921114 Merged /trunk/phase3/includes/installer:r85021,85066

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81755Followup to r81657, you do need a space between the table name and the aliasoverlordq15:34, 8 February 2011
r82596Merge r67177 from 1.16wmf4platonides10:26, 22 February 2011
r85021(bug 28237) Installer doesn't create extension tablesmaxsem17:32, 30 March 2011
r85047Followup to r85021, fix caller in updater maintenance scriptoverlordq20:56, 30 March 2011
r85066Follow-up r85021: fix commentmaxsem14:11, 31 March 2011

Comments

#Comment by Liangent (talk | contribs)   08:09, 18 May 2011

- return $this->tableName( $name ) . ' ' . $this->addIdentifierQuotes( $alias ); + return $this->tableName( $name ) . ' ' . $this->addQuotes( $alias );

You changed a correct line to a buggy one (already fixed in r81833, you can simply merge it).

Actually r81755 shouldn't be merged...

#Comment by 😂 (talk | contribs)   22:29, 18 May 2011

Went ahead and merged r81833 in r88396, tableNameWithAlias() is now identical in trunk and REL1_17.

Status & tagging log