- list( $tables, $index, $userCond, $join_cond ) = $this->getUserCond();
-
- $user = $this->getUser();
- $conds = array_merge( $userCond, $this->getNamespaceCond() );
-
- // Paranoia: avoid brute force searches (T19342)
- if ( !$user->isAllowed( 'deletedhistory' ) ) {
- $conds[] = $this->mDb->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0';
- } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
- $conds[] = $this->mDb->bitAnd( 'rev_deleted', Revision::SUPPRESSED_USER ) .
- ' != ' . Revision::SUPPRESSED_USER;
- }
-
- # Don't include orphaned revisions
- $join_cond['page'] = Revision::pageJoinCond();
- # Get the current user name for accounts
- $join_cond['user'] = Revision::userJoinCond();
-
- $options = [];
- if ( $index ) {
- $options['USE INDEX'] = [ 'revision' => $index ];
- }
-