'rev_timestamp < ' . $dbr->addQuotes( $dbr->timestamp( $new->getTimestamp() ) )
);
if ( $max !== null ) {
- $res = $dbr->select( 'revision', '1',
+ return $dbr->selectRowCount( 'revision', '1',
$conds,
__METHOD__,
array( 'LIMIT' => $max + 1 ) // extra to detect truncation
);
- return $res->numRows();
} else {
return (int)$dbr->selectField( 'revision', 'count(*)', $conds, __METHOD__ );
}
if ( isset( $this->prop['unreadcount'] ) ) {
$dbr = $this->getQuery()->getNamedDB( 'watchlist', DB_SLAVE, 'watchlist' );
- $sql = $dbr->selectSQLText(
+ $count = $dbr->selectRowCount(
'watchlist',
- array( 'dummy' => 1 ),
+ '1',
array(
'wl_user' => $user->getId(),
'wl_notificationtimestamp IS NOT NULL',
__METHOD__,
array( 'LIMIT' => self::WL_UNREAD_LIMIT )
);
- $count = $dbr->selectField( array( 'c' => "($sql)" ), 'COUNT(*)' );
if ( $count >= self::WL_UNREAD_LIMIT ) {
$vals['unreadcount'] = self::WL_UNREAD_LIMIT . '+';