Index: trunk/phase3/includes/api/ApiQueryWatchlist.php |
— | — | @@ -172,9 +172,10 @@ |
173 | 173 | if ( !is_null( $params['excludeuser'] ) ) |
174 | 174 | $this->addWhere( 'rc_user_text != ' . $this->getDB()->addQuotes( $params['excludeuser'] ) ); |
175 | 175 | |
176 | | - global $wgDBtype; |
| 176 | + $db = $this->getDB(); |
| 177 | + |
177 | 178 | // This is an index optimization for mysql, as done in the Special:Watchlist page |
178 | | - $this->addWhereIf( "rc_timestamp > ''", !isset ( $params['start'] ) && !isset ( $params['end'] ) && $wgDBtype == 'mysql' ); |
| 179 | + $this->addWhereIf( "rc_timestamp > ''", !isset ( $params['start'] ) && !isset ( $params['end'] ) && $db->getType() == 'mysql' ); |
179 | 180 | |
180 | 181 | $this->addOption( 'LIMIT', $params['limit'] + 1 ); |
181 | 182 | |
— | — | @@ -182,7 +183,6 @@ |
183 | 184 | $count = 0; |
184 | 185 | $res = $this->select( __METHOD__ ); |
185 | 186 | |
186 | | - $db = $this->getDB(); |
187 | 187 | while ( $row = $db->fetchObject( $res ) ) { |
188 | 188 | if ( ++ $count > $params['limit'] ) { |
189 | 189 | // We've reached the one extra which shows that there are additional pages to be had. Stop here... |