foreach( $write as $table ) {
$tbl = $this->tableName( $table ) .
- $lowPriority ? ' LOW_PRIORITY' : '' .
+ ( $lowPriority ? ' LOW_PRIORITY' : '' ) .
' WRITE';
$items[] = $tbl;
}
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__ );
}
/**
* @param &$db Database object
*/
private function unlockSearchindex( &$db ) {
- $db->query( "UNLOCK TABLES", 'updateSearchIndex.php ' . __METHOD__ );
+ $db->unlockTables( 'updateSearchIndex.php ' . __METHOD__ );
}
/**