r52721 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52720‎ | r52721 | r52722 >
Date:23:59, 2 July 2009
Author:demon
Status:deferred
Tags:
Comment:
* Port deleteArchivedFiles, dumpSisterSites, orphans
* Tweak Database::lockTables() and children to allow for non-LOW PRIORITY writes
* Added missing abstract functions
Modified paths:
  • /branches/maintenance-work/includes/db/Database.php (modified) (history)
  • /branches/maintenance-work/includes/db/DatabaseMssql.php (modified) (history)
  • /branches/maintenance-work/includes/db/DatabaseMysql.php (modified) (history)
  • /branches/maintenance-work/includes/db/DatabaseOracle.php (modified) (history)
  • /branches/maintenance-work/includes/db/DatabaseSqlite.php (modified) (history)
  • /branches/maintenance-work/maintenance/deleteArchivedFiles.inc (deleted) (history)
  • /branches/maintenance-work/maintenance/deleteArchivedFiles.php (modified) (history)
  • /branches/maintenance-work/maintenance/dumpSisterSites.php (modified) (history)
  • /branches/maintenance-work/maintenance/orphans.php (modified) (history)

Diff [purge]

Index: branches/maintenance-work/maintenance/deleteArchivedFiles.inc
@@ -1,56 +0,0 @@
2 -<?php
3 -
4 -/**
5 - * Support functions for the deleteArchivedFiles script
6 - *
7 - * @file
8 - * @ingroup Maintenance
9 - * @author Aaron Schulz
10 - */
11 -
12 -require_once( "$IP/includes/FileStore.php" );
13 -require_once( "$IP/includes/filerepo/File.php" );
14 -
15 -function DeleteArchivedFiles( $delete = false ) {
16 -
17 - # Data should come off the master, wrapped in a transaction
18 - $dbw = wfGetDB( DB_MASTER );
19 -
20 - $transaction = new FSTransaction();
21 - if( !FileStore::lock() ) {
22 - wfDebug( __METHOD__.": failed to acquire file store lock, aborting\n" );
23 - return false;
24 - }
25 -
26 - $tbl_arch = $dbw->tableName( 'filearchive' );
27 -
28 - # Get "active" revisions from the filearchive table
29 - echo( "Searching for and deleting archived files...\n" );
30 - $res = $dbw->query( "SELECT fa_id,fa_storage_group,fa_storage_key FROM $tbl_arch" );
31 - while( $row = $dbw->fetchObject( $res ) ) {
32 - $key = $row->fa_storage_key;
33 - $group = $row->fa_storage_group;
34 - $id = $row->fa_id;
35 -
36 - $store = FileStore::get( $group );
37 - if( $store ) {
38 - $path = $store->filePath( $key );
39 - $sha1 = substr( $key, 0, strcspn( $key, '.' ) );
40 - $inuse = $dbw->selectField( 'oldimage', '1',
41 - array( 'oi_sha1' => $sha1,
42 - 'oi_deleted & '.File::DELETED_FILE => File::DELETED_FILE ),
43 - __METHOD__, array( 'FOR UPDATE' ) );
44 - if ( $path && file_exists($path) && !$inuse ) {
45 - $transaction->addCommit( FSTransaction::DELETE_FILE, $path );
46 - $dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" );
47 - } else {
48 - echo( "Notice - file '$key' not found in group '$group'\n" );
49 - }
50 - } else {
51 - echo( "Notice - invalid file storage group '$group' for file '$key'\n" );
52 - }
53 - }
54 - echo( "done.\n" );
55 -
56 - $transaction->commit();
57 -}
Index: branches/maintenance-work/maintenance/dumpSisterSites.php
@@ -25,25 +25,33 @@
2626 * @ingroup SpecialPage
2727 */
2828
29 -require_once( 'commandLine.inc' );
 29+require_once( "Maintenance.php" );
3030
31 -$dbr = wfGetDB( DB_SLAVE );
32 -$dbr->bufferResults( false );
33 -$result = $dbr->select( 'page',
34 - array( 'page_namespace', 'page_title' ),
35 - array(
36 - 'page_namespace' => NS_MAIN,
37 - 'page_is_redirect' => 0,
38 - ),
39 - 'dumpSisterSites' );
 31+class DumpSisterSites extends Maintenance {
 32+ public function __construct() {
 33+ parent::__construct();
 34+ $this->mDescription = "Quickie page name dump script for SisterSites usage";
 35+ }
 36+
 37+ public function execute() {
 38+ $dbr = wfGetDB( DB_SLAVE );
 39+ $dbr->bufferResults( false );
 40+ $result = $dbr->select( 'page',
 41+ array( 'page_namespace', 'page_title' ),
 42+ array( 'page_namespace' => NS_MAIN,
 43+ 'page_is_redirect' => 0,
 44+ ),
 45+ __METHOD__ );
4046
41 -while( $row = $dbr->fetchObject( $result ) ) {
42 - $title = Title::makeTitle( $row->page_namespace, $row->page_title );
43 - $url = $title->getFullUrl();
44 - $text = $title->getPrefixedText();
45 - echo "$url $text\n";
 47+ while( $row = $dbr->fetchObject( $result ) ) {
 48+ $title = Title::makeTitle( $row->page_namespace, $row->page_title );
 49+ $url = $title->getFullUrl();
 50+ $text = $title->getPrefixedText();
 51+ $this->output( "$url $text\n" );
 52+ }
 53+ $dbr->freeResult( $result );
 54+ }
4655 }
4756
48 -$dbr->freeResult( $result );
49 -
50 -
 57+$maintClass = "DumpSisterSites";
 58+require_once( DO_MAINTENANCE );
Index: branches/maintenance-work/maintenance/orphans.php
@@ -28,179 +28,211 @@
2929 * @ingroup Maintenance
3030 */
3131
32 -$options = array( 'fix' );
 32+require_once( "Maintenance.php" );
3333
34 -/** */
35 -require_once( 'commandLine.inc' );
36 -$wgTitle = Title::newFromText( 'Orphan revision cleanup script' );
37 -
38 -checkOrphans( isset( $options['fix'] ) );
39 -checkSeparation( isset( $options['fix'] ) );
40 -#checkWidows( isset( $options['fix'] ) );
41 -
42 -# ------
43 -
44 -function checkOrphans( $fix ) {
45 - $dbw = wfGetDB( DB_MASTER );
46 - $page = $dbw->tableName( 'page' );
47 - $revision = $dbw->tableName( 'revision' );
48 -
49 - if( $fix ) {
50 - $dbw->query( "LOCK TABLES $page WRITE, $revision WRITE" );
 34+class Orphans extends Maintenance {
 35+ public function __construct() {
 36+ parent::__construct();
 37+ $this->mDescription = "Look for 'orphan' revisions hooked to pages which don't exist\n" .
 38+ "And 'childless' pages with no revisions\n" .
 39+ "Then, kill the poor widows and orphans\n" .
 40+ "Man this is depressing";
 41+ $this->addOption( 'fix', 'Actually fix broken entries' );
5142 }
5243
53 - echo "Checking for orphan revision table entries... (this may take a while on a large wiki)\n";
54 - $result = $dbw->query( "
55 - SELECT *
56 - FROM $revision LEFT OUTER JOIN $page ON rev_page=page_id
57 - WHERE page_id IS NULL
58 - ");
59 - $orphans = $dbw->numRows( $result );
60 - if( $orphans > 0 ) {
61 - global $wgContLang;
62 - echo "$orphans orphan revisions...\n";
63 - printf( "%10s %10s %14s %20s %s\n", 'rev_id', 'rev_page', 'rev_timestamp', 'rev_user_text', 'rev_comment' );
64 - while( $row = $dbw->fetchObject( $result ) ) {
65 - $comment = ( $row->rev_comment == '' )
66 - ? ''
67 - : '(' . $wgContLang->truncate( $row->rev_comment, 40 ) . ')';
68 - printf( "%10d %10d %14s %20s %s\n",
69 - $row->rev_id,
70 - $row->rev_page,
71 - $row->rev_timestamp,
72 - $wgContLang->truncate( $row->rev_user_text, 17 ),
73 - $comment );
74 - if( $fix ) {
75 - $dbw->delete( 'revision', array( 'rev_id' => $row->rev_id ) );
76 - }
77 - }
78 - if( !$fix ) {
79 - echo "Run again with --fix to remove these entries automatically.\n";
80 - }
81 - } else {
82 - echo "No orphans! Yay!\n";
 44+ public function execute() {
 45+ global $wgTitle;
 46+ $wgTitle = Title::newFromText( 'Orphan revision cleanup script' );
 47+ $this->checkOrphans( $this->hasOption( 'fix' ) );
 48+ $this->checkSeparation( $this->hasOption( 'fix' ) );
 49+ # Does not work yet, do not use
 50+ # $this->checkWidows( $this->hasOption( 'fix' ) );
8351 }
8452
85 - if( $fix ) {
86 - $dbw->query( "UNLOCK TABLES" );
 53+ /**
 54+ * Lock the appropriate tables for the script
 55+ * @param $db Database object
 56+ * @param $extraTable String The name of any extra tables to lock (eg: text)
 57+ */
 58+ private function lockTables( &$db, $extraTable = null ) {
 59+ $tbls = array( 'page', 'revision' );
 60+ if( $extraTable )
 61+ $tbls[] = $extraTable;
 62+ $db->lockTables( array(), $tbls, __METHOD__, false );
8763 }
88 -}
8964
90 -/**
91 - * @todo DON'T USE THIS YET! It will remove entries which have children,
92 - * but which aren't properly attached (eg if page_latest is bogus
93 - * but valid revisions do exist)
94 - */
95 -function checkWidows( $fix ) {
96 - $dbw = wfGetDB( DB_MASTER );
97 - $page = $dbw->tableName( 'page' );
98 - $revision = $dbw->tableName( 'revision' );
99 -
100 - if( $fix ) {
101 - $dbw->query( "LOCK TABLES $page WRITE, $revision WRITE" );
102 - }
103 -
104 - echo "\nChecking for childless page table entries... (this may take a while on a large wiki)\n";
105 - $result = $dbw->query( "
106 - SELECT *
107 - FROM $page LEFT OUTER JOIN $revision ON page_latest=rev_id
108 - WHERE rev_id IS NULL
109 - ");
110 - $widows = $dbw->numRows( $result );
111 - if( $widows > 0 ) {
112 - global $wgContLang;
113 - echo "$widows childless pages...\n";
114 - printf( "%10s %11s %2s %s\n", 'page_id', 'page_latest', 'ns', 'page_title' );
115 - while( $row = $dbw->fetchObject( $result ) ) {
116 - printf( "%10d %11d %2d %s\n",
117 - $row->page_id,
118 - $row->page_latest,
119 - $row->page_namespace,
120 - $row->page_title );
121 - if( $fix ) {
122 - $dbw->delete( 'page', array( 'page_id' => $row->page_id ) );
 65+ /**
 66+ * Check for orphan revisions
 67+ * @param $fix bool Whether to fix broken revisions when found
 68+ */
 69+ private function checkOrphans( $fix ) {
 70+ $dbw = wfGetDB( DB_MASTER );
 71+ $page = $dbw->tableName( 'page' );
 72+ $revision = $dbw->tableName( 'revision' );
 73+
 74+ if( $fix ) {
 75+ $this->lockTables( $dbw );
 76+ }
 77+
 78+ $this->output( "Checking for orphan revision table entries... (this may take a while on a large wiki)\n" );
 79+ $result = $dbw->query( "
 80+ SELECT *
 81+ FROM $revision LEFT OUTER JOIN $page ON rev_page=page_id
 82+ WHERE page_id IS NULL
 83+ ");
 84+ $orphans = $dbw->numRows( $result );
 85+ if( $orphans > 0 ) {
 86+ global $wgContLang;
 87+ $this->output( "$orphans orphan revisions...\n" );
 88+ $this->output( sprintf( "%10s %10s %14s %20s %s\n", 'rev_id', 'rev_page', 'rev_timestamp', 'rev_user_text', 'rev_comment' ) );
 89+ while( $row = $dbw->fetchObject( $result ) ) {
 90+ $comment = ( $row->rev_comment == '' )
 91+ ? ''
 92+ : '(' . $wgContLang->truncate( $row->rev_comment, 40 ) . ')';
 93+ $this->output( sprintf( "%10d %10d %14s %20s %s\n",
 94+ $row->rev_id,
 95+ $row->rev_page,
 96+ $row->rev_timestamp,
 97+ $wgContLang->truncate( $row->rev_user_text, 17 ),
 98+ $comment ) );
 99+ if( $fix ) {
 100+ $dbw->delete( 'revision', array( 'rev_id' => $row->rev_id ) );
 101+ }
123102 }
 103+ if( !$fix ) {
 104+ $this->output( "Run again with --fix to remove these entries automatically.\n" );
 105+ }
 106+ } else {
 107+ $this->output( "No orphans! Yay!\n" );
124108 }
125 - if( !$fix ) {
126 - echo "Run again with --fix to remove these entries automatically.\n";
 109+
 110+ if( $fix ) {
 111+ $dbw->unlockTables();
127112 }
128 - } else {
129 - echo "No childless pages! Yay!\n";
130113 }
131114
132 - if( $fix ) {
133 - $dbw->query( "UNLOCK TABLES" );
134 - }
135 -}
 115+ /**
 116+ * @param $fix bool
 117+ * @todo DON'T USE THIS YET! It will remove entries which have children,
 118+ * but which aren't properly attached (eg if page_latest is bogus
 119+ * but valid revisions do exist)
 120+ */
 121+ private function checkWidows( $fix ) {
 122+ $dbw = wfGetDB( DB_MASTER );
 123+ $page = $dbw->tableName( 'page' );
 124+ $revision = $dbw->tableName( 'revision' );
136125
 126+ if( $fix ) {
 127+ $this->lockTables( $dbw );
 128+ }
137129
138 -function checkSeparation( $fix ) {
139 - $dbw = wfGetDB( DB_MASTER );
140 - $page = $dbw->tableName( 'page' );
141 - $revision = $dbw->tableName( 'revision' );
142 - $text = $dbw->tableName( 'text' );
143 -
144 - if( $fix ) {
145 - $dbw->query( "LOCK TABLES $page WRITE, $revision WRITE, $text WRITE" );
146 - }
147 -
148 - echo "\nChecking for pages whose page_latest links are incorrect... (this may take a while on a large wiki)\n";
149 - $result = $dbw->query( "
150 - SELECT *
151 - FROM $page LEFT OUTER JOIN $revision ON page_latest=rev_id
152 - ");
153 - $found = 0;
154 - while( $row = $dbw->fetchObject( $result ) ) {
155 - $result2 = $dbw->query( "
156 - SELECT MAX(rev_timestamp) as max_timestamp
157 - FROM $revision
158 - WHERE rev_page=$row->page_id
159 - " );
160 - $row2 = $dbw->fetchObject( $result2 );
161 - $dbw->freeResult( $result2 );
162 - if( $row2 ) {
163 - if( $row->rev_timestamp != $row2->max_timestamp ) {
164 - if( $found == 0 ) {
165 - printf( "%10s %10s %14s %14s\n",
166 - 'page_id', 'rev_id', 'timestamp', 'max timestamp' );
167 - }
168 - ++$found;
169 - printf( "%10d %10d %14s %14s\n",
 130+ $this->output( "\nChecking for childless page table entries... (this may take a while on a large wiki)\n" );
 131+ $result = $dbw->query( "
 132+ SELECT *
 133+ FROM $page LEFT OUTER JOIN $revision ON page_latest=rev_id
 134+ WHERE rev_id IS NULL
 135+ ");
 136+ $widows = $dbw->numRows( $result );
 137+ if( $widows > 0 ) {
 138+ global $wgContLang;
 139+ $this->output( "$widows childless pages...\n" );
 140+ $this->output( sprintf( "%10s %11s %2s %s\n", 'page_id', 'page_latest', 'ns', 'page_title' ) );
 141+ while( $row = $dbw->fetchObject( $result ) ) {
 142+ printf( "%10d %11d %2d %s\n",
170143 $row->page_id,
171144 $row->page_latest,
172 - $row->rev_timestamp,
173 - $row2->max_timestamp );
 145+ $row->page_namespace,
 146+ $row->page_title );
174147 if( $fix ) {
175 - # ...
176 - $maxId = $dbw->selectField(
177 - 'revision',
178 - 'rev_id',
179 - array(
180 - 'rev_page' => $row->page_id,
181 - 'rev_timestamp' => $row2->max_timestamp ) );
182 - echo "... updating to revision $maxId\n";
183 - $maxRev = Revision::newFromId( $maxId );
184 - $title = Title::makeTitle( $row->page_namespace, $row->page_title );
185 - $article = new Article( $title );
186 - $article->updateRevisionOn( $dbw, $maxRev );
 148+ $dbw->delete( 'page', array( 'page_id' => $row->page_id ) );
187149 }
188150 }
 151+ if( !$fix ) {
 152+ $this->output( "Run again with --fix to remove these entries automatically.\n" );
 153+ }
189154 } else {
190 - echo "wtf\n";
 155+ $this->output( "No childless pages! Yay!\n" );
191156 }
 157+
 158+ if( $fix ) {
 159+ $dbw->unlockTables();
 160+ }
192161 }
193162
194 - if( $found ) {
195 - echo "Found $found pages with incorrect latest revision.\n";
196 - } else {
197 - echo "No pages with incorrect latest revision. Yay!\n";
 163+ /**
 164+ * Check for pages where page_latest is wrong
 165+ * @param $fix bool Whether to fix broken entries
 166+ */
 167+ private function checkSeparation( $fix ) {
 168+ $dbw = wfGetDB( DB_MASTER );
 169+ $page = $dbw->tableName( 'page' );
 170+ $revision = $dbw->tableName( 'revision' );
 171+ $text = $dbw->tableName( 'text' );
 172+
 173+ if( $fix ) {
 174+ $dbw->lockTables( $dbw, 'text' );
 175+ }
 176+
 177+ $this->output( "\nChecking for pages whose page_latest links are incorrect... (this may take a while on a large wiki)\n" );
 178+ $result = $dbw->query( "
 179+ SELECT *
 180+ FROM $page LEFT OUTER JOIN $revision ON page_latest=rev_id
 181+ ");
 182+ $found = 0;
 183+ while( $row = $dbw->fetchObject( $result ) ) {
 184+ $result2 = $dbw->query( "
 185+ SELECT MAX(rev_timestamp) as max_timestamp
 186+ FROM $revision
 187+ WHERE rev_page=$row->page_id
 188+ " );
 189+ $row2 = $dbw->fetchObject( $result2 );
 190+ $dbw->freeResult( $result2 );
 191+ if( $row2 ) {
 192+ if( $row->rev_timestamp != $row2->max_timestamp ) {
 193+ if( $found == 0 ) {
 194+ $this->output( sprintf( "%10s %10s %14s %14s\n",
 195+ 'page_id', 'rev_id', 'timestamp', 'max timestamp' ) );
 196+ }
 197+ ++$found;
 198+ $this->output( sprintf( "%10d %10d %14s %14s\n",
 199+ $row->page_id,
 200+ $row->page_latest,
 201+ $row->rev_timestamp,
 202+ $row2->max_timestamp ) );
 203+ if( $fix ) {
 204+ # ...
 205+ $maxId = $dbw->selectField(
 206+ 'revision',
 207+ 'rev_id',
 208+ array(
 209+ 'rev_page' => $row->page_id,
 210+ 'rev_timestamp' => $row2->max_timestamp ) );
 211+ $this->output( "... updating to revision $maxId\n" );
 212+ $maxRev = Revision::newFromId( $maxId );
 213+ $title = Title::makeTitle( $row->page_namespace, $row->page_title );
 214+ $article = new Article( $title );
 215+ $article->updateRevisionOn( $dbw, $maxRev );
 216+ }
 217+ }
 218+ } else {
 219+ $this->output( "wtf\n" );
 220+ }
 221+ }
 222+
 223+ if( $found ) {
 224+ $this->output( "Found $found pages with incorrect latest revision.\n" );
 225+ } else {
 226+ $this->output( "No pages with incorrect latest revision. Yay!\n" );
 227+ }
 228+ if( !$fix && $found > 0 ) {
 229+ $this->output( "Run again with --fix to remove these entries automatically.\n" );
 230+ }
 231+
 232+ if( $fix ) {
 233+ $dbw->unlockTables();
 234+ }
198235 }
199 - if( !$fix && $found > 0 ) {
200 - echo "Run again with --fix to remove these entries automatically.\n";
201 - }
202 -
203 - if( $fix ) {
204 - $dbw->query( "UNLOCK TABLES" );
205 - }
206236 }
207237
 238+$maintClass = "Orphans";
 239+require_once( DO_MAINTENANCE );
Index: branches/maintenance-work/maintenance/deleteArchivedFiles.php
@@ -9,23 +9,59 @@
1010 * Based on deleteOldRevisions.php by Rob Church
1111 */
1212
13 -$options = array( 'delete', 'help' );
14 -require_once( 'commandLine.inc' );
15 -require_once( 'deleteArchivedFiles.inc' );
 13+require_once( "Maintenance.php" );
1614
17 -echo( "Delete Archived Images\n\n" );
 15+class DeleteArchivedFiles extends Maintenance {
 16+ public function __construct() {
 17+ parent::__construct();
 18+ $this->mDescription = "Deletes all archived images.";
 19+ $this->addOption( 'delete', 'Perform the deletion' );
 20+ }
1821
19 -if( @$options['help'] ) {
20 - ShowUsage();
21 -} else {
22 - DeleteArchivedFiles( @$options['delete'] );
23 -}
 22+ public function execute() {
 23+ $this->output( "Delete Archived Images\n\n" );
2424
25 -function ShowUsage() {
26 - echo( "Deletes all archived images.\n\n" );
27 - echo( "These images will no longer be restorable.\n\n" );
28 - echo( "Usage: php deleteArchivedRevisions.php [--delete|--help]\n\n" );
29 - echo( "delete : Performs the deletion\n" );
30 - echo( " help : Show this usage information\n" );
 25+ # Data should come off the master, wrapped in a transaction
 26+ $dbw = wfGetDB( DB_MASTER );
 27+ $transaction = new FSTransaction();
 28+ if( !$dbw->lock() ) {
 29+ wfDebug( __METHOD__ . ": failed to acquire DB lock, aborting\n" );
 30+ return false;
 31+ }
 32+
 33+ $tbl_arch = $dbw->tableName( 'filearchive' );
 34+
 35+ # Get "active" revisions from the filearchive table
 36+ $this->output( "Searching for and deleting archived files...\n" );
 37+ $res = $dbw->query( "SELECT fa_id,fa_storage_group,fa_storage_key FROM $tbl_arch" );
 38+ while( $row = $dbw->fetchObject( $res ) ) {
 39+ $key = $row->fa_storage_key;
 40+ $group = $row->fa_storage_group;
 41+ $id = $row->fa_id;
 42+
 43+ $store = FileStore::get( $group );
 44+ if( $store ) {
 45+ $path = $store->filePath( $key );
 46+ $sha1 = substr( $key, 0, strcspn( $key, '.' ) );
 47+ $inuse = $dbw->selectField( 'oldimage', '1',
 48+ array( 'oi_sha1' => $sha1,
 49+ 'oi_deleted & '.File::DELETED_FILE => File::DELETED_FILE ),
 50+ __METHOD__, array( 'FOR UPDATE' ) );
 51+ if ( $path && file_exists($path) && !$inuse ) {
 52+ $transaction->addCommit( FSTransaction::DELETE_FILE, $path );
 53+ $dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" );
 54+ } else {
 55+ $this->output( "Notice - file '$key' not found in group '$group'\n" );
 56+ }
 57+ } else {
 58+ $this->output( "Notice - invalid file storage group '$group' for file '$key'\n" );
 59+ }
 60+ }
 61+ $this->output( "done.\n" );
 62+
 63+ $transaction->commit();
 64+ }
3165 }
3266
 67+$maintClass = "DeleteArchivedFiles";
 68+require_once( DO_MAINTENANCE );
Index: branches/maintenance-work/includes/db/DatabaseMysql.php
@@ -315,11 +315,14 @@
316316 return $row->lockstatus;
317317 }
318318
319 - public function lockTables( $read, $write, $method ) {
 319+ public function lockTables( $read, $write, $method, $lowPriority = true ) {
320320 $items = array();
321321
322322 foreach( $write as $table ) {
323 - $items[] = $this->tableName( $table ) . ' LOW_PRIORITY WRITE';
 323+ $tbl = $this->tableName( $table ) .
 324+ $lowPriority ? ' LOW_PRIORITY' : '' .
 325+ ' WRITE';
 326+ $items[] = $tbl;
324327 }
325328 foreach( $read as $table ) {
326329 $items[] = $this->tableName( $table ) . ' READ';
Index: branches/maintenance-work/includes/db/DatabaseOracle.php
@@ -1069,7 +1069,12 @@
10701070 public function unlock( $lockName, $method ) {
10711071 return true;
10721072 }
1073 -
 1073+ public function lockTables( $read, $write, $method, $lowPriority = true ) {
 1074+ return true;
 1075+ }
 1076+ public function unlockTables( $method ) {
 1077+ return true;
 1078+ }
10741079 public function getSearchEngine() {
10751080 return "SearchOracle";
10761081 }
Index: branches/maintenance-work/includes/db/Database.php
@@ -2206,8 +2206,9 @@
22072207 * @param $read Array of tables to lock for read access
22082208 * @param $write Array of tables to lock for write access
22092209 * @param $method String name of caller
 2210+ * @param $lowPriority bool Whether to indicate writes to be LOW PRIORITY
22102211 */
2211 - abstract public function lockTables( $read, $write, $method );
 2212+ abstract public function lockTables( $read, $write, $method, $lowPriority = true );
22122213
22132214 /**
22142215 * Unlock specific tables
Index: branches/maintenance-work/includes/db/DatabaseMssql.php
@@ -981,6 +981,12 @@
982982 public function unlock( $lockName, $method ) {
983983 return true;
984984 }
 985+ public function lockTables( $read, $write, $method, $lowPriority = true ) {
 986+ return true;
 987+ }
 988+ public function unlockTables( $method ) {
 989+ return true;
 990+ }
985991
986992 public function getSearchEngine() {
987993 return "SearchEngineDummy";
Index: branches/maintenance-work/includes/db/DatabaseSqlite.php
@@ -455,7 +455,7 @@
456456 /** No-op */
457457 public function setBigSelects( $value = true ) {}
458458
459 - public function lockTables( $read, $write, $method ) {}
 459+ public function lockTables( $read, $write, $method, $lowPriority = true ) {}
460460
461461 public function unlockTables( $method ) {}
462462

Status & tagging log