*/
class ContribsFinder {
- var $username, $offset, $limit, $namespace, $timestampcol;
+ var $username, $offset, $limit, $namespace;
var $dbr;
/**
$this->username = $username;
$this->namespace = false;
$this->dbr = wfGetDB( DB_SLAVE, 'contributions' );
- $this->timestampcol = $this->dbr->realTimestamps()
- ? "TO_CHAR(rev_timestamp, 'YYYYMMDDHH24MISS')"
- : "rev_timestamp";
}
function setNamespace( $ns ) {
list( $page, $revision ) = $this->dbr->tableNamesN( 'page', 'revision' );
$sql = "SELECT rev_timestamp FROM $page, $revision $use_index " .
- "WHERE page_id = rev_page AND $this->timestampcol > '" . $this->offset . "' AND " .
+ "WHERE page_id = rev_page AND rev_timestamp > '" . $this->dbr->timestamp($this->offset) . "' AND " .
$usercond . $nscond;
$sql .= " ORDER BY rev_timestamp ASC";
$sql = $this->dbr->limitResult( $sql, $this->limit, 0 );
list( $index, $userCond ) = $this->getUserCond();
if ( $this->offset ) {
- $offsetQuery = "AND $this->timestampcol < '{$this->offset}'";
- }
+ $offsetQuery = "AND rev_timestamp < '" . $this->dbr->timestamp($this->offset) . "'";
+ }
$nscond = $this->getNamespaceCond();
$use_index = $this->dbr->useIndexClause( $index );