Since all those used ApiQueryBase::addWhereRange, added ApiQueryBase::addTimestampWhereRange, which does automagic timestamp conversion. Not tested whether this actually fixes problems in Postgres, but at least the API modules are still functional in SQLite
* (bug 26885) Allow show/hide of account blocks, temporary blocks and single IP
address blocks for list=blocks.
* (bug 30591) Add support to only return keys in ApiAllMessages.
+* (bug 29392) Setting the start or end parameter now works with lists blocks,
+ categorymembers, deletedrevs, logevents, protectedtitles, usercontributions
+ and watchlist in Postgres
=== Languages updated in 1.19 ===
}
}
}
+ /**
+ * Add a WHERE clause corresponding to a range, similar to addWhereRange,
+ * but converts $start and $end to database timestamps.
+ * @see addWhereRange
+ */
+ protected function addTimestampWhereRange( $field, $dir, $start, $end, $sort = true ) {
+ $db = $this->getDb();
+ return $this->addWhereRange( $field, $dir,
+ $db->timestamp( $start ), $db->timestamp( $end ), $sort );
+ }
/**
* Add an option such as LIMIT or USE INDEX. If an option was set
$fld_flags );
$this->addOption( 'LIMIT', $params['limit'] + 1 );
- $this->addWhereRange( 'ipb_timestamp', $params['dir'], $params['start'], $params['end'] );
+ $this->addTimestampWhereRange( 'ipb_timestamp', $params['dir'], $params['start'], $params['end'] );
if ( isset( $params['ids'] ) ) {
$this->addWhereFld( 'ipb_id', $params['ids'] );
}
$this->addWhereRange( 'ar_namespace', $dir, null, null );
$this->addWhereRange( 'ar_title', $dir, null, null );
}
- $this->addWhereRange( 'ar_timestamp', $dir, $params['start'], $params['end'] );
+ $this->addTimestampWhereRange( 'ar_timestamp', $dir, $params['start'], $params['end'] );
}
$res = $this->select( __METHOD__ );
$pageMap = array(); // Maps ns&title to (fake) pageid
$index['logging'] = 'type_time';
}
- $this->addWhereRange( 'log_timestamp', $params['dir'], $params['start'], $params['end'] );
+ $this->addTimestampWhereRange( 'log_timestamp', $params['dir'], $params['start'], $params['end'] );
$limit = $params['limit'];
$this->addOption( 'LIMIT', $limit + 1 );
$this->addFieldsIf( 'pt_expiry', isset( $prop['expiry'] ) );
$this->addFieldsIf( 'pt_create_perm', isset( $prop['level'] ) );
- $this->addWhereRange( 'pt_timestamp', $params['dir'], $params['start'], $params['end'] );
+ $this->addTimestampWhereRange( 'pt_timestamp', $params['dir'], $params['start'], $params['end'] );
$this->addWhereFld( 'pt_namespace', $params['namespace'] );
$this->addWhereFld( 'pt_create_perm', $params['level'] );
*/
$this->addTables( 'recentchanges' );
$index = array( 'recentchanges' => 'rc_timestamp' ); // May change
- $this->addWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
+ $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
$this->addWhereFld( 'rc_namespace', $params['namespace'] );
$this->addWhereFld( 'rc_deleted', 0 );
// one row with the same timestamp for the same page.
// The order needs to be the same as start parameter to avoid SQL filesort.
if ( is_null( $params['startid'] ) && is_null( $params['endid'] ) ) {
- $this->addWhereRange( 'rev_timestamp', $params['dir'],
+ $this->addTimestampWhereRange( 'rev_timestamp', $params['dir'],
$params['start'], $params['end'] );
} else {
$this->addWhereRange( 'rev_id', $params['dir'],
$params['startid'], $params['endid'] );
// One of start and end can be set
// If neither is set, this does nothing
- $this->addWhereRange( 'rev_timestamp', $params['dir'],
+ $this->addTimestampWhereRange( 'rev_timestamp', $params['dir'],
$params['start'], $params['end'], false );
}
if ( $this->multiUserMode ) {
$this->addWhereRange( 'rev_user_text', $this->params['dir'], null, null );
}
- $this->addWhereRange( 'rev_timestamp',
+ $this->addTimestampWhereRange( 'rev_timestamp',
$this->params['dir'], $this->params['start'], $this->params['end'] );
$this->addWhereFld( 'page_namespace', $this->params['namespace'] );
$db = $this->getDB();
- $this->addWhereRange( 'rc_timestamp', $params['dir'],
- $db->timestamp( $params['start'] ),
- $db->timestamp( $params['end'] ) );
+ $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'],
+ $params['start'], $params['end'] );
$this->addWhereFld( 'wl_namespace', $params['namespace'] );
if ( !$params['allrev'] ) {