diff options
author | Max Semenik <maxsem@users.mediawiki.org> | 2009-10-25 09:42:00 +0000 |
---|---|---|
committer | Max Semenik <maxsem@users.mediawiki.org> | 2009-10-25 09:42:00 +0000 |
commit | 08b430460adb4c5daf9ef3fa98cec02fe260a602 (patch) | |
tree | b2132c136a6671f2c9098292d441ead480ed318f /maintenance/updateSearchIndex.php | |
parent | c2b1bf51deb9a74e852e0e3851b77823439f545c (diff) | |
download | mediawikicore-08b430460adb4c5daf9ef3fa98cec02fe260a602.tar.gz mediawikicore-08b430460adb4c5daf9ef3fa98cec02fe260a602.zip |
* Abstracted table locks in maintenance/updateSearchIndex.php
* Fixed MySQL's table locking, stabstabstab PHP
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/58108
Diffstat (limited to 'maintenance/updateSearchIndex.php')
-rw-r--r-- | maintenance/updateSearchIndex.php | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/maintenance/updateSearchIndex.php b/maintenance/updateSearchIndex.php index 0adfd15219fe..6bb290ff1d25 100644 --- a/maintenance/updateSearchIndex.php +++ b/maintenance/updateSearchIndex.php @@ -147,16 +147,7 @@ class UpdateSearchIndex extends Maintenance { private function lockSearchindex( &$db ) { $write = array( 'searchindex' ); $read = array( 'page', 'revision', 'text', 'interwiki' ); - $items = array(); - - foreach( $write as $table ) { - $items[] = $db->tableName( $table ) . ' LOW_PRIORITY WRITE'; - } - foreach( $read as $table ) { - $items[] = $db->tableName( $table ) . ' READ'; - } - $sql = "LOCK TABLES " . implode( ',', $items ); - $db->query( $sql, 'updateSearchIndex.php ' . __METHOD__ ); + $db->lockTables( $read, $write, 'updateSearchIndex.php ' . __METHOD__ ); } /** @@ -164,7 +155,7 @@ class UpdateSearchIndex extends Maintenance { * @param &$db Database object */ private function unlockSearchindex( &$db ) { - $db->query( "UNLOCK TABLES", 'updateSearchIndex.php ' . __METHOD__ ); + $db->unlockTables( 'updateSearchIndex.php ' . __METHOD__ ); } /** |