r112339 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112338‎ | r112339 | r112340 >
Date:18:45, 24 February 2012
Author:reedy
Status:ok
Tags:
Comment:
More __METHOD__ in our madness
Modified paths:
  • /trunk/phase3/docs/database.txt (modified) (history)
  • /trunk/phase3/includes/UserMailer.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseIbm_db2.php (modified) (history)
  • /trunk/phase3/includes/db/DatabasePostgres.php (modified) (history)
  • /trunk/phase3/includes/filerepo/file/LocalFile.php (modified) (history)
  • /trunk/phase3/includes/filerepo/file/OldLocalFile.php (modified) (history)
  • /trunk/phase3/includes/installer/MysqlInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/PostgresInstaller.php (modified) (history)
  • /trunk/phase3/includes/job/JobQueue.php (modified) (history)
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/cleanupImages.php (modified) (history)
  • /trunk/phase3/maintenance/cleanupSpam.php (modified) (history)
  • /trunk/phase3/maintenance/deleteArchivedFiles.inc (modified) (history)
  • /trunk/phase3/maintenance/deleteArchivedRevisions.inc (modified) (history)
  • /trunk/phase3/maintenance/deleteBatch.php (modified) (history)
  • /trunk/phase3/maintenance/deleteDefaultMessages.php (modified) (history)
  • /trunk/phase3/maintenance/deleteOldRevisions.php (modified) (history)
  • /trunk/phase3/maintenance/deleteOrphanedRevisions.php (modified) (history)
  • /trunk/phase3/maintenance/fixSlaveDesync.php (modified) (history)
  • /trunk/phase3/maintenance/migrateUserGroup.php (modified) (history)
  • /trunk/phase3/maintenance/nukeNS.php (modified) (history)
  • /trunk/phase3/maintenance/nukePage.php (modified) (history)
  • /trunk/phase3/maintenance/populateLogUsertext.php (modified) (history)
  • /trunk/phase3/maintenance/populateRevisionSha1.php (modified) (history)
  • /trunk/phase3/maintenance/purgeOldText.inc (modified) (history)
  • /trunk/phase3/maintenance/reassignEdits.php (modified) (history)
  • /trunk/phase3/maintenance/rebuildFileCache.php (modified) (history)
  • /trunk/phase3/maintenance/refreshLinks.php (modified) (history)
  • /trunk/phase3/maintenance/removeUnusedAccounts.php (modified) (history)
  • /trunk/phase3/maintenance/storage/fixBug20757.php (modified) (history)
  • /trunk/phase3/maintenance/storage/recompressTracked.php (modified) (history)
  • /trunk/phase3/maintenance/updateCollation.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/storage/fixBug20757.php
@@ -213,7 +213,7 @@
214214
215215 if ( !$dryRun ) {
216216 // Reset the text row to point to the original copy
217 - $dbw->begin();
 217+ $dbw->begin( __METHOD__ );
218218 $dbw->update(
219219 'text',
220220 // SET
@@ -241,7 +241,7 @@
242242 ),
243243 __METHOD__
244244 );
245 - $dbw->commit();
 245+ $dbw->commit( __METHOD__ );
246246 $this->waitForSlaves();
247247 }
248248
Index: trunk/phase3/maintenance/storage/recompressTracked.php
@@ -528,7 +528,7 @@
529529 exit( 1 );
530530 }
531531 $dbw = wfGetDB( DB_MASTER );
532 - $dbw->begin();
 532+ $dbw->begin( __METHOD__ );
533533 $dbw->update( 'text',
534534 array( // set
535535 'old_text' => $url,
@@ -544,7 +544,7 @@
545545 array( 'bt_text_id' => $textId ),
546546 __METHOD__
547547 );
548 - $dbw->commit();
 548+ $dbw->commit( __METHOD__ );
549549 }
550550
551551 /**
@@ -739,7 +739,7 @@
740740 //
741741 // We do a locking read to prevent closer-run race conditions.
742742 $dbw = wfGetDB( DB_MASTER );
743 - $dbw->begin();
 743+ $dbw->begin( __METHOD__ );
744744 $res = $dbw->select( 'blob_tracking',
745745 array( 'bt_text_id', 'bt_moved' ),
746746 array( 'bt_text_id' => array_keys( $this->referrers ) ),
@@ -773,7 +773,7 @@
774774 $store = $this->parent->store;
775775 $targetDB = $store->getMaster( $targetCluster );
776776 $targetDB->clearFlag( DBO_TRX ); // we manage the transactions
777 - $targetDB->begin();
 777+ $targetDB->begin( __METHOD__ );
778778 $baseUrl = $this->parent->store->store( $targetCluster, serialize( $this->cgz ) );
779779
780780 // Write the new URLs to the blob_tracking table
@@ -789,10 +789,10 @@
790790 );
791791 }
792792
793 - $targetDB->commit();
 793+ $targetDB->commit( __METHOD__ );
794794 // Critical section here: interruption at this point causes blob duplication
795795 // Reversing the order of the commits would cause data loss instead
796 - $dbw->commit();
 796+ $dbw->commit( __METHOD__ );
797797
798798 // Write the new URLs to the text table and set the moved flag
799799 if ( !$this->parent->copyOnly ) {
Index: trunk/phase3/maintenance/rebuildFileCache.php
@@ -93,7 +93,7 @@
9494 array( 'ORDER BY' => 'page_id ASC', 'USE INDEX' => 'PRIMARY' )
9595 );
9696
97 - $dbw->begin(); // for any changes
 97+ $dbw->begin( __METHOD__ ); // for any changes
9898 foreach ( $res as $row ) {
9999 $rebuilt = false;
100100 $wgRequestTime = microtime( true ); # bug 22852
@@ -139,7 +139,7 @@
140140 $this->output( "Page {$row->page_id} not cacheable\n" );
141141 }
142142 }
143 - $dbw->commit(); // commit any changes (just for sanity)
 143+ $dbw->commit( __METHOD__ ); // commit any changes (just for sanity)
144144
145145 $blockStart += $this->mBatchSize;
146146 $blockEnd += $this->mBatchSize;
Index: trunk/phase3/maintenance/refreshLinks.php
@@ -217,13 +217,13 @@
218218 return;
219219 }
220220
221 - $dbw->begin();
 221+ $dbw->begin( __METHOD__ );
222222
223223 $options = new ParserOptions;
224224 $parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() );
225225 $update = new LinksUpdate( $title, $parserOutput, false );
226226 $update->doUpdate();
227 - $dbw->commit();
 227+ $dbw->commit( __METHOD__ );
228228 }
229229
230230 /**
Index: trunk/phase3/maintenance/removeUnusedAccounts.php
@@ -95,12 +95,12 @@
9696 'image' => 'img', 'oldimage' => 'oi', 'filearchive' => 'fa' );
9797 $count = 0;
9898
99 - $dbo->begin();
 99+ $dbo->begin( __METHOD__ );
100100 foreach ( $checks as $table => $fprefix ) {
101101 $conds = array( $fprefix . '_user' => $id );
102102 $count += (int)$dbo->selectField( $table, 'COUNT(*)', $conds, __METHOD__ );
103103 }
104 - $dbo->commit();
 104+ $dbo->commit( __METHOD__ );
105105
106106 return $count == 0;
107107 }
Index: trunk/phase3/maintenance/updateCollation.php
@@ -104,7 +104,7 @@
105105 );
106106 $this->output( " processing..." );
107107
108 - $dbw->begin();
 108+ $dbw->begin( __METHOD__ );
109109 foreach ( $res as $row ) {
110110 $title = Title::newFromRow( $row );
111111 if ( !$row->cl_collation ) {
@@ -143,7 +143,7 @@
144144 __METHOD__
145145 );
146146 }
147 - $dbw->commit();
 147+ $dbw->commit( __METHOD__ );
148148
149149 if ( $force && $row ) {
150150 $encFrom = $dbw->addQuotes( $row->cl_from );
Index: trunk/phase3/maintenance/nukePage.php
@@ -38,7 +38,7 @@
3939 $delete = $this->getOption( 'delete', false );
4040
4141 $dbw = wfGetDB( DB_MASTER );
42 - $dbw->begin();
 42+ $dbw->begin( __METHOD__ );
4343
4444 $tbl_pag = $dbw->tableName( 'page' );
4545 $tbl_rec = $dbw->tableName( 'recentchanges' );
@@ -93,20 +93,20 @@
9494 }
9595 } else {
9696 $this->output( "not found in database.\n" );
97 - $dbw->commit();
 97+ $dbw->commit( __METHOD__ );
9898 }
9999 }
100100
101101 public function deleteRevisions( $ids ) {
102102 $dbw = wfGetDB( DB_MASTER );
103 - $dbw->begin();
 103+ $dbw->begin( __METHOD__ );
104104
105105 $tbl_rev = $dbw->tableName( 'revision' );
106106
107107 $set = implode( ', ', $ids );
108108 $dbw->query( "DELETE FROM $tbl_rev WHERE rev_id IN ( $set )" );
109109
110 - $dbw->commit();
 110+ $dbw->commit( __METHOD__ );
111111 }
112112 }
113113
Index: trunk/phase3/maintenance/nukeNS.php
@@ -49,7 +49,7 @@
5050 $delete = $this->getOption( 'delete', false );
5151 $all = $this->getOption( 'all', false );
5252 $dbw = wfGetDB( DB_MASTER );
53 - $dbw->begin();
 53+ $dbw->begin( __METHOD__ );
5454
5555 $tbl_pag = $dbw->tableName( 'page' );
5656 $tbl_rev = $dbw->tableName( 'revision' );
@@ -80,7 +80,7 @@
8181 // I already have the id & revs
8282 if ( $delete ) {
8383 $dbw->query( "DELETE FROM $tbl_pag WHERE page_id = $id" );
84 - $dbw->commit();
 84+ $dbw->commit( __METHOD__ );
8585 // Delete revisions as appropriate
8686 $child = $this->runChild( 'NukePage', 'nukePage.php' );
8787 $child->deleteRevisions( $revs );
@@ -91,7 +91,7 @@
9292 $this->output( "skip: " . $title->getPrefixedText() . "\n" );
9393 }
9494 }
95 - $dbw->commit();
 95+ $dbw->commit( __METHOD__ );
9696
9797 if ( $n_deleted > 0 ) {
9898 # update statistics - better to decrement existing count, or just count
Index: trunk/phase3/maintenance/deleteBatch.php
@@ -89,7 +89,7 @@
9090 }
9191
9292 $this->output( $title->getPrefixedText() );
93 - $dbw->begin();
 93+ $dbw->begin( __METHOD__ );
9494 if ( $title->getNamespace() == NS_FILE ) {
9595 $img = wfFindFile( $title );
9696 if ( $img && $img->isLocal() && !$img->delete( $reason ) ) {
@@ -99,7 +99,7 @@
100100 $page = WikiPage::factory( $title );
101101 $error = '';
102102 $success = $page->doDeleteArticle( $reason, false, 0, false, $error, $user );
103 - $dbw->commit();
 103+ $dbw->commit( __METHOD__ );
104104 if ( $success ) {
105105 $this->output( " Deleted!\n" );
106106 } else {
Index: trunk/phase3/maintenance/purgeOldText.inc
@@ -27,7 +27,7 @@
2828
2929 # Data should come off the master, wrapped in a transaction
3030 $dbw = wfGetDB( DB_MASTER );
31 - $dbw->begin();
 31+ $dbw->begin( __METHOD__ );
3232
3333 $tbl_arc = $dbw->tableName( 'archive' );
3434 $tbl_rev = $dbw->tableName( 'revision' );
@@ -73,6 +73,6 @@
7474 }
7575
7676 # Done
77 - $dbw->commit();
 77+ $dbw->commit( __METHOD__ );
7878
7979 }
Index: trunk/phase3/maintenance/populateRevisionSha1.php
@@ -81,13 +81,13 @@
8282 AND $idCol IS NOT NULL AND {$prefix}_sha1 = ''";
8383 $res = $db->select( $table, '*', $cond, __METHOD__ );
8484
85 - $db->begin();
 85+ $db->begin( __METHOD__ );
8686 foreach ( $res as $row ) {
8787 if ( $this->upgradeRow( $row, $table, $idCol, $prefix ) ) {
8888 $count++;
8989 }
9090 }
91 - $db->commit();
 91+ $db->commit( __METHOD__ );
9292
9393 $blockStart += $this->mBatchSize;
9494 $blockEnd += $this->mBatchSize;
@@ -102,20 +102,20 @@
103103 $res = $db->select( 'archive', '*', array( 'ar_rev_id IS NULL' ), __METHOD__ );
104104
105105 $updateSize = 0;
106 - $db->begin();
 106+ $db->begin( __METHOD__ );
107107 foreach ( $res as $row ) {
108108 if ( $this->upgradeLegacyArchiveRow( $row ) ) {
109109 ++$count;
110110 }
111111 if ( ++$updateSize >= 100 ) {
112112 $updateSize = 0;
113 - $db->commit();
 113+ $db->commit( __METHOD__ );
114114 $this->output( "Commited row with ar_timestamp={$row->ar_timestamp}\n" );
115115 wfWaitForSlaves();
116 - $db->begin();
 116+ $db->begin( __METHOD__ );
117117 }
118118 }
119 - $db->commit();
 119+ $db->commit( __METHOD__ );
120120 }
121121
122122 protected function upgradeRow( $row, $table, $idCol, $prefix ) {
Index: trunk/phase3/maintenance/deleteArchivedRevisions.inc
@@ -34,7 +34,7 @@
3535 static public function doDelete( $maint ) {
3636 $dbw = wfGetDB( DB_MASTER );
3737
38 - $dbw->begin();
 38+ $dbw->begin( __METHOD__ );
3939
4040 $tbl_arch = $dbw->tableName( 'archive' );
4141
@@ -49,7 +49,7 @@
5050
5151 # This bit's done
5252 # Purge redundant text records
53 - $dbw->commit();
 53+ $dbw->commit( __METHOD__ );
5454 if ( $deletedRows ) {
5555 $maint->purgeRedundantText( true );
5656 }
Index: trunk/phase3/maintenance/deleteDefaultMessages.php
@@ -68,10 +68,10 @@
6969 $dbw->ping();
7070 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
7171 $page = WikiPage::factory( $title );
72 - $dbw->begin();
 72+ $dbw->begin( __METHOD__ );
7373 $error = ''; // Passed by ref
7474 $page->doDeleteArticle( 'No longer required', false, 0, false, $error, $user );
75 - $dbw->commit();
 75+ $dbw->commit( __METHOD__ );
7676 }
7777
7878 $this->output( 'done!', 'msg' );
Index: trunk/phase3/maintenance/migrateUserGroup.php
@@ -50,14 +50,14 @@
5151 // Migrate users over in batches...
5252 while ( $blockEnd <= $end ) {
5353 $this->output( "Doing users $blockStart to $blockEnd\n" );
54 - $dbw->begin();
 54+ $dbw->begin( __METHOD__ );
5555 $dbw->update( 'user_groups',
5656 array( 'ug_group' => $newGroup ),
5757 array( 'ug_group' => $oldGroup,
5858 "ug_user BETWEEN $blockStart AND $blockEnd" )
5959 );
6060 $count += $dbw->affectedRows();
61 - $dbw->commit();
 61+ $dbw->commit( __METHOD__ );
6262 $blockStart += $this->mBatchSize;
6363 $blockEnd += $this->mBatchSize;
6464 wfWaitForSlaves();
Index: trunk/phase3/maintenance/cleanupImages.php
@@ -156,7 +156,7 @@
157157 } else {
158158 $this->output( "renaming $path to $finalPath\n" );
159159 // @todo FIXME: Should this use File::move()?
160 - $db->begin();
 160+ $db->begin( __METHOD__ );
161161 $db->update( 'image',
162162 array( 'img_name' => $final ),
163163 array( 'img_name' => $orig ),
@@ -178,10 +178,10 @@
179179 }
180180 }
181181 if ( rename( $path, $finalPath ) ) {
182 - $db->commit();
 182+ $db->commit( __METHOD__ );
183183 } else {
184184 $this->error( "RENAME FAILED" );
185 - $db->rollback();
 185+ $db->rollback( __METHOD__ );
186186 }
187187 }
188188 }
Index: trunk/phase3/maintenance/Maintenance.php
@@ -954,7 +954,7 @@
955955 public function purgeRedundantText( $delete = true ) {
956956 # Data should come off the master, wrapped in a transaction
957957 $dbw = $this->getDB( DB_MASTER );
958 - $dbw->begin();
 958+ $dbw->begin( __METHOD__ );
959959
960960 $tbl_arc = $dbw->tableName( 'archive' );
961961 $tbl_rev = $dbw->tableName( 'revision' );
@@ -999,7 +999,7 @@
10001000 }
10011001
10021002 # Done
1003 - $dbw->commit();
 1003+ $dbw->commit( __METHOD__ );
10041004 }
10051005
10061006 /**
Index: trunk/phase3/maintenance/reassignEdits.php
@@ -68,7 +68,7 @@
6969 */
7070 private function doReassignEdits( &$from, &$to, $rc = false, $report = false ) {
7171 $dbw = wfGetDB( DB_MASTER );
72 - $dbw->begin();
 72+ $dbw->begin( __METHOD__ );
7373
7474 # Count things
7575 $this->output( "Checking current edits..." );
@@ -117,7 +117,7 @@
118118 }
119119 }
120120
121 - $dbw->commit();
 121+ $dbw->commit( __METHOD__ );
122122 return (int)$total;
123123 }
124124
Index: trunk/phase3/maintenance/cleanupSpam.php
@@ -106,7 +106,7 @@
107107 $this->output( "False match\n" );
108108 } else {
109109 $dbw = wfGetDB( DB_MASTER );
110 - $dbw->begin();
 110+ $dbw->begin( __METHOD__ );
111111 $page = WikiPage::factory( $title );
112112 if ( !$rev ) {
113113 // Didn't find a non-spammy revision, blank the page
@@ -118,7 +118,7 @@
119119 $page->doEdit( $rev->getText(), wfMsgForContent( 'spam_reverting', $domain ),
120120 EDIT_UPDATE, $rev->getId() );
121121 }
122 - $dbw->commit();
 122+ $dbw->commit( __METHOD__ );
123123 }
124124 }
125125 }
Index: trunk/phase3/maintenance/populateLogUsertext.php
@@ -59,12 +59,12 @@
6060 $res = $db->select( array( 'logging', 'user' ),
6161 array( 'log_id', 'user_name' ), $cond, __METHOD__ );
6262
63 - $db->begin();
 63+ $db->begin( __METHOD__ );
6464 foreach ( $res as $row ) {
6565 $db->update( 'logging', array( 'log_user_text' => $row->user_name ),
6666 array( 'log_id' => $row->log_id ), __METHOD__ );
6767 }
68 - $db->commit();
 68+ $db->commit( __METHOD__ );
6969 $blockStart += $this->mBatchSize;
7070 $blockEnd += $this->mBatchSize;
7171 wfWaitForSlaves();
Index: trunk/phase3/maintenance/deleteOldRevisions.php
@@ -41,7 +41,7 @@
4242
4343 # Data should come off the master, wrapped in a transaction
4444 $dbw = wfGetDB( DB_MASTER );
45 - $dbw->begin();
 45+ $dbw->begin( __METHOD__ );
4646
4747 $tbl_pag = $dbw->tableName( 'page' );
4848 $tbl_rev = $dbw->tableName( 'revision' );
@@ -90,7 +90,7 @@
9191
9292 # This bit's done
9393 # Purge redundant text records
94 - $dbw->commit();
 94+ $dbw->commit( __METHOD__ );
9595 if ( $delete ) {
9696 $this->purgeRedundantText( true );
9797 }
Index: trunk/phase3/maintenance/deleteArchivedFiles.inc
@@ -24,7 +24,7 @@
2525 static public function doDelete( $output, $force ) {
2626 # Data should come off the master, wrapped in a transaction
2727 $dbw = wfGetDB( DB_MASTER );
28 - $dbw->begin();
 28+ $dbw->begin( __METHOD__ );
2929 $tbl_arch = $dbw->tableName( 'filearchive' );
3030 $repo = RepoGroup::singleton()->getLocalRepo();
3131 # Get "active" revisions from the filearchive table
@@ -59,7 +59,7 @@
6060 }
6161 }
6262 }
63 - $dbw->commit();
 63+ $dbw->commit( __METHOD__ );
6464 $output->handleOutput( "Done! [$count file(s)]\n" );
6565 }
6666 }
\ No newline at end of file
Index: trunk/phase3/maintenance/deleteOrphanedRevisions.php
@@ -39,7 +39,7 @@
4040 $report = $this->hasOption( 'report' );
4141
4242 $dbw = wfGetDB( DB_MASTER );
43 - $dbw->begin();
 43+ $dbw->begin( __METHOD__ );
4444 list( $page, $revision ) = $dbw->tableNamesN( 'page', 'revision' );
4545
4646 # Find all the orphaned revisions
@@ -66,7 +66,7 @@
6767 $this->output( "done.\n" );
6868
6969 # Close the transaction and call the script to purge unused text records
70 - $dbw->commit();
 70+ $dbw->commit( __METHOD__ );
7171 $this->purgeRedundantText( true );
7272 }
7373
Index: trunk/phase3/maintenance/fixSlaveDesync.php
@@ -88,7 +88,7 @@
8989 private function desyncFixPage( $pageID ) {
9090 # Check for a corrupted page_latest
9191 $dbw = wfGetDB( DB_MASTER );
92 - $dbw->begin();
 92+ $dbw->begin( __METHOD__ );
9393 $realLatest = $dbw->selectField( 'page', 'page_latest', array( 'page_id' => $pageID ),
9494 __METHOD__, 'FOR UPDATE' );
9595 # list( $masterFile, $masterPos ) = $dbw->getMasterPos();
@@ -112,7 +112,7 @@
113113 }
114114 if ( !$found ) {
115115 $this->output( "page_id $pageID seems fine\n" );
116 - $dbw->commit();
 116+ $dbw->commit( __METHOD__ );
117117 return;
118118 }
119119
@@ -199,7 +199,7 @@
200200 }
201201 $this->output( "done\n" );
202202 }
203 - $dbw->commit();
 203+ $dbw->commit( __METHOD__ );
204204 }
205205 }
206206
Index: trunk/phase3/docs/database.txt
@@ -153,9 +153,9 @@
154154 following syntax:
155155
156156 $dbw = wfGetDB( DB_MASTER );
157 -$dbw->begin();
 157+$dbw->begin( __METHOD__ );
158158 /* Do queries */
159 -$dbw->commit();
 159+$dbw->commit( __METHOD__ );
160160
161161 Use of locking reads (e.g. the FOR UPDATE clause) is not advised. They
162162 are poorly implemented in InnoDB and will cause regular deadlock errors.
Index: trunk/phase3/includes/db/DatabasePostgres.php
@@ -540,7 +540,7 @@
541541 if ( $ignore ) {
542542 $olde = error_reporting( $olde );
543543 if ( $didbegin ) {
544 - $this->commit();
 544+ $this->commit( __METHOD__ );
545545 }
546546
547547 // Set the affected row count for the whole operation
@@ -587,7 +587,7 @@
588588 $didbegin = 0;
589589 if ( $ignore ) {
590590 if( !$this->mTrxLevel ) {
591 - $this->begin();
 591+ $this->begin( __METHOD__ );
592592 $didbegin = 1;
593593 }
594594 $olde = error_reporting( 0 );
@@ -616,7 +616,7 @@
617617 }
618618 $olde = error_reporting( $olde );
619619 if( $didbegin ) {
620 - $this->commit();
 620+ $this->commit( __METHOD__ );
621621 }
622622
623623 // Set the affected row count for the whole operation
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php
@@ -791,9 +791,9 @@
792792 protected function applySchema() {
793793 if ( !( $this->mSchemaSet ) ) {
794794 $this->mSchemaSet = true;
795 - $this->begin();
 795+ $this->begin( __METHOD__ );
796796 $this->doQuery( "SET SCHEMA = $this->mSchema" );
797 - $this->commit();
 797+ $this->commit( __METHOD__ );
798798 }
799799 }
800800
@@ -1016,7 +1016,7 @@
10171017 $res = true;
10181018 // If we are not in a transaction, we need to be for savepoint trickery
10191019 if ( !$this->mTrxLevel ) {
1020 - $this->begin();
 1020+ $this->begin( __METHOD__ );
10211021 }
10221022
10231023 $sql = "INSERT INTO $table ( " . implode( ',', $keys ) . ' ) VALUES ';
@@ -1031,7 +1031,7 @@
10321032 $stmt = $this->prepare( $sql );
10331033
10341034 // start a transaction/enter transaction mode
1035 - $this->begin();
 1035+ $this->begin( __METHOD__ );
10361036
10371037 if ( !$ignore ) {
10381038 //$first = true;
Index: trunk/phase3/includes/UserMailer.php
@@ -448,7 +448,7 @@
449449 if ( $watchers ) {
450450 // Update wl_notificationtimestamp for all watching users except
451451 // the editor
452 - $dbw->begin();
 452+ $dbw->begin( __METHOD__ );
453453 $dbw->update( 'watchlist',
454454 array( /* SET */
455455 'wl_notificationtimestamp' => $dbw->timestamp( $timestamp )
@@ -458,7 +458,7 @@
459459 'wl_user' => $watchers
460460 ), __METHOD__
461461 );
462 - $dbw->commit();
 462+ $dbw->commit( __METHOD__ );
463463 }
464464 }
465465
Index: trunk/phase3/includes/filerepo/file/OldLocalFile.php
@@ -260,7 +260,7 @@
261261 */
262262 function recordOldUpload( $srcPath, $archiveName, $timestamp, $comment, $user ) {
263263 $dbw = $this->repo->getMasterDB();
264 - $dbw->begin();
 264+ $dbw->begin( __METHOD__ );
265265
266266 $dstPath = $this->repo->getZonePath( 'public' ) . '/' . $this->getRel();
267267 $props = $this->repo->getFileProps( $dstPath );
@@ -288,9 +288,9 @@
289289 ), __METHOD__
290290 );
291291
292 - $dbw->commit();
 292+ $dbw->commit( __METHOD__ );
293293
294294 return true;
295295 }
296 -
 296+
297297 }
Index: trunk/phase3/includes/filerepo/file/LocalFile.php
@@ -959,7 +959,7 @@
960960 }
961961
962962 $dbw = $this->repo->getMasterDB();
963 - $dbw->begin();
 963+ $dbw->begin( __METHOD__ );
964964
965965 if ( !$props ) {
966966 $props = $this->repo->getFileProps( $this->getVirtualUrl() );
@@ -1111,7 +1111,7 @@
11121112
11131113 # Commit the transaction now, in case something goes wrong later
11141114 # The most important thing is that files don't get lost, especially archives
1115 - $dbw->commit();
 1115+ $dbw->commit( __METHOD__ );
11161116
11171117 # Save to cache and purge the squid
11181118 # We shall not saveToCache before the commit since otherwise
@@ -1409,7 +1409,7 @@
14101410 $dbw = $this->repo->getMasterDB();
14111411
14121412 if ( !$this->locked ) {
1413 - $dbw->begin();
 1413+ $dbw->begin( __METHOD__ );
14141414 $this->locked++;
14151415 }
14161416
@@ -1425,7 +1425,7 @@
14261426 --$this->locked;
14271427 if ( !$this->locked ) {
14281428 $dbw = $this->repo->getMasterDB();
1429 - $dbw->commit();
 1429+ $dbw->commit( __METHOD__ );
14301430 }
14311431 }
14321432 }
@@ -1436,7 +1436,7 @@
14371437 function unlockAndRollback() {
14381438 $this->locked = false;
14391439 $dbw = $this->repo->getMasterDB();
1440 - $dbw->rollback();
 1440+ $dbw->rollback( __METHOD__ );
14411441 }
14421442 } // LocalFile class
14431443
@@ -2215,17 +2215,17 @@
22162216 return $statusMove;
22172217 }
22182218
2219 - $this->db->begin();
 2219+ $this->db->begin( __METHOD__ );
22202220 $statusDb = $this->doDBUpdates();
22212221 wfDebugLog( 'imagemove', "Renamed {$this->file->getName()} in database: {$statusDb->successCount} successes, {$statusDb->failCount} failures" );
22222222 if ( !$statusDb->isGood() ) {
2223 - $this->db->rollback();
 2223+ $this->db->rollback( __METHOD__ );
22242224 // Something went wrong with the DB updates, so remove the target files
22252225 $this->cleanupTarget( $triplets );
22262226 $statusDb->ok = false;
22272227 return $statusDb;
22282228 }
2229 - $this->db->commit();
 2229+ $this->db->commit( __METHOD__ );
22302230
22312231 // Everything went ok, remove the source files
22322232 $this->cleanupSource( $triplets );
Index: trunk/phase3/includes/installer/MysqlInstaller.php
@@ -514,9 +514,9 @@
515515 $fullName = $this->buildFullUserName( $dbUser, $host );
516516 if( !$this->userDefinitelyExists( $dbUser, $host ) ) {
517517 try{
518 - $this->db->begin();
 518+ $this->db->begin( __METHOD__ );
519519 $this->db->query( "CREATE USER $fullName IDENTIFIED BY $escPass", __METHOD__ );
520 - $this->db->commit();
 520+ $this->db->commit( __METHOD__ );
521521 $grantableNames[] = $fullName;
522522 } catch( DBQueryError $dqe ) {
523523 if( $this->db->lastErrno() == 1396 /* ER_CANNOT_USER */ ) {
@@ -544,11 +544,11 @@
545545 $dbAllTables = $this->db->addIdentifierQuotes( $dbName ) . '.*';
546546 foreach( $grantableNames as $name ) {
547547 try {
548 - $this->db->begin();
 548+ $this->db->begin( __METHOD__ );
549549 $this->db->query( "GRANT ALL PRIVILEGES ON $dbAllTables TO $name", __METHOD__ );
550 - $this->db->commit();
 550+ $this->db->commit( __METHOD__ );
551551 } catch( DBQueryError $dqe ) {
552 - $this->db->rollback();
 552+ $this->db->rollback( __METHOD__ );
553553 $status->fatal( 'config-install-user-grant-failed', $dbUser, $dqe->getText() );
554554 }
555555 }
Index: trunk/phase3/includes/installer/PostgresInstaller.php
@@ -147,7 +147,7 @@
148148 */
149149 $conn = $status->value;
150150 $conn->clearFlag( DBO_TRX );
151 - $conn->commit();
 151+ $conn->commit( __METHOD__ );
152152 $this->pgConns[$type] = $conn;
153153 }
154154 return $status;
@@ -478,7 +478,7 @@
479479 }
480480
481481 function commitChanges() {
482 - $this->db->commit();
 482+ $this->db->commit( __METHOD__ );
483483 return Status::newGood();
484484 }
485485
Index: trunk/phase3/includes/job/JobQueue.php
@@ -56,7 +56,7 @@
5757
5858 $dbw = wfGetDB( DB_MASTER );
5959
60 - $dbw->begin();
 60+ $dbw->begin( __METHOD__ );
6161
6262 $row = $dbw->selectRow(
6363 'job',
@@ -67,7 +67,7 @@
6868 );
6969
7070 if ( $row === false ) {
71 - $dbw->commit();
 71+ $dbw->commit( __METHOD__ );
7272 wfProfileOut( __METHOD__ );
7373 return false;
7474 }
@@ -75,7 +75,7 @@
7676 /* Ensure we "own" this row */
7777 $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
7878 $affected = $dbw->affectedRows();
79 - $dbw->commit();
 79+ $dbw->commit( __METHOD__ );
8080
8181 if ( $affected == 0 ) {
8282 wfProfileOut( __METHOD__ );
@@ -146,7 +146,7 @@
147147 $dbw = wfGetDB( DB_MASTER );
148148 $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
149149 $affected = $dbw->affectedRows();
150 - $dbw->commit();
 150+ $dbw->commit( __METHOD__ );
151151
152152 if ( !$affected ) {
153153 // Failed, someone else beat us to it
@@ -170,7 +170,7 @@
171171 // Delete the random row
172172 $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
173173 $affected = $dbw->affectedRows();
174 - $dbw->commit();
 174+ $dbw->commit( __METHOD__ );
175175
176176 if ( !$affected ) {
177177 // Random job gone before we exclusively deleted it
@@ -260,16 +260,16 @@
261261 $rows[] = $job->insertFields();
262262 if ( count( $rows ) >= 50 ) {
263263 # Do a small transaction to avoid slave lag
264 - $dbw->begin();
 264+ $dbw->begin( __METHOD__ );
265265 $dbw->insert( 'job', $rows, __METHOD__, 'IGNORE' );
266 - $dbw->commit();
 266+ $dbw->commit( __METHOD__ );
267267 $rows = array();
268268 }
269269 }
270270 if ( $rows ) { // last chunk
271 - $dbw->begin();
 271+ $dbw->begin( __METHOD__ );
272272 $dbw->insert( 'job', $rows, __METHOD__, 'IGNORE' );
273 - $dbw->commit();
 273+ $dbw->commit( __METHOD__ );
274274 }
275275 wfIncrStats( 'job-insert', count( $jobs ) );
276276 }
@@ -369,10 +369,10 @@
370370 $fields = $this->insertFields();
371371 unset( $fields['job_id'] );
372372 $dbw = wfGetDB( DB_MASTER );
373 - $dbw->begin();
 373+ $dbw->begin( __METHOD__ );
374374 $dbw->delete( 'job', $fields, __METHOD__ );
375375 $affected = $dbw->affectedRows();
376 - $dbw->commit();
 376+ $dbw->commit( __METHOD__ );
377377 if ( $affected ) {
378378 wfIncrStats( 'job-dup-delete', $affected );
379379 }

Status & tagging log