* @param $method String: Name of method calling us
* @return bool
*/
- abstract public function lock( $lockName, $method, $timeout = 5 );
+ public function lock( $lockName, $method, $timeout = 5 ) {
+ return true;
+ }
/**
* Release a lock.
* by this thread (in which case the lock is not released), and NULL if the named
* lock did not exist
*/
- abstract public function unlock( $lockName, $method );
+ public function unlock( $lockName, $method ) {
+ return true;
+ }
/**
* Lock specific tables
* @param $read Array of tables to lock for read access
* @param $write Array of tables to lock for write access
* @param $method String name of caller
+ * @param $lowPriority bool Whether to indicate writes to be LOW PRIORITY
*/
- abstract public function lockTables( $read, $write, $method );
+ public function lockTables( $read, $write, $method, $lowPriority = true ) {
+ return true;
+ }
/**
* Unlock specific tables
*
* @param $method String the caller
*/
- abstract public function unlockTables( $method );
+ public function unlockTables( $method ) {
+ return true;
+ }
/**
* Get search engine class. All subclasses of this
$this->applySchema();
$this->begin();
- $res = dbsource( "../maintenance/ibm_db2/tables.sql", $this);
+ $res = $this->sourceFile( "../maintenance/ibm_db2/tables.sql" );
$res = null;
// TODO: update mediawiki_version table
* TODO
* @return bool true
*/
- public function lock( $lockName, $method ) { wfDebug('Not implemented for DB2: lock()'); return true; }
- /**
- * Not implemented
- * TODO
- * @return bool true
- */
- public function unlock( $lockName, $method ) { wfDebug('Not implemented for DB2: unlock()'); return true; }
/**
* Not implemented
* @deprecated
}
}
- /**
- * No-op lock functions
- */
- public function lock( $lockName, $method ) {
- return true;
- }
- public function unlock( $lockName, $method ) {
- return true;
- }
-
public function getSearchEngine() {
return "SearchEngineDummy";
}
return $row->lockstatus;
}
- public function lockTables( $read, $write, $method ) {
+ public function lockTables( $read, $write, $method, $lowPriority = true ) {
$items = array();
foreach( $write as $table ) {
- $items[] = $this->tableName( $table ) . ' LOW_PRIORITY WRITE';
+ $tbl = $this->tableName( $table ) .
+ $lowPriority ? ' LOW_PRIORITY' : '' .
+ ' WRITE';
+ $items[] = $tbl;
}
foreach( $read as $table ) {
$items[] = $this->tableName( $table ) . ' READ';
global $wgVersion, $wgDBmwschema, $wgDBts2schema, $wgDBport, $wgDBuser;
echo "<li>Creating DB objects</li>\n";
- $res = dbsource( "../maintenance/ora/tables.sql", $this);
+ $res = $this->sourceFile( "../maintenance/ora/tables.sql" );
// Avoid the non-standard "REPLACE INTO" syntax
echo "<li>Populating table interwiki</li>\n";
return parent::replaceVars($ins);
}
- /**
- * No-op lock functions
- */
- public function lock( $lockName, $method ) {
- return true;
- }
- public function unlock( $lockName, $method ) {
- return true;
- }
-
public function getSearchEngine() {
return "SearchOracle";
}
}
$this->doQuery("DROP TABLE $safeschema.$ctest");
- $res = dbsource( "../maintenance/postgres/tables.sql", $this);
+ $res = $this->sourceFile( "../maintenance/postgres/tables.sql" );
## Update version information
$mwv = $this->addQuotes($wgVersion);
return implode( ' || ', $stringList );
}
- /* These are not used yet, but we know we don't want the default version */
-
- public function lock( $lockName, $method, $timeout = 5 ) {
- return true;
- }
- public function unlock( $lockName, $method ) {
- return true;
- }
-
public function getSearchEngine() {
return "SearchPostgres";
}
-
- /** Todo: maybe implement this? */
- public function lockTables( $read, $write, $method ) {}
-
- public function unlockTables( $method ) {}
-
} // end DatabasePostgres class
}
}
- /**
- * No-op lock functions
- */
- public function lock( $lockName, $method, $timeout = 5 ) {
- return true;
- }
- public function unlock( $lockName, $method ) {
- return true;
- }
-
public function getSearchEngine() {
return "SearchEngineDummy";
}
return $s;
}
- public function lockTables( $read, $write, $method ) {}
-
- public function unlockTables( $method ) {}
-
/*
* Build a concatenation list to feed into a SQL query
*/