Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php |
— | — | @@ -161,14 +161,14 @@ |
162 | 162 | } |
163 | 163 | |
164 | 164 | function getRevCountQuery( $dbr ) { |
165 | | - $tables = array( $dbr->tableName( 'code_rev' ) ); |
| 165 | + $tables = array( 'code_rev' ); |
166 | 166 | $selectFields = array( 'COUNT( DISTINCT cr_id ) AS rev_count' ); |
167 | 167 | // count if code_rev where path matches |
168 | 168 | if ( $this->mPath ) { |
169 | | - $tables[] = $dbr->tableName( 'code_paths' ); |
| 169 | + $tables[] = 'code_paths'; |
170 | 170 | $whereCond = array('cr_repo_id' => $this->mRepo->getId(), |
171 | 171 | 'cr_id = cp_rev_id', |
172 | | - ' cp_path LIKE ' . $dbr->addQuotes( $this->mPath . '%' ), |
| 172 | + ' cp_path' . $dbr->buildLike( $this->mPath, $dbr->anyString() ), |
173 | 173 | // performance |
174 | 174 | ' cp_rev_id > ' . ( $this->mRepo->getLastStoredRev() - 20000 ) |
175 | 175 | ); |
— | — | @@ -176,7 +176,7 @@ |
177 | 177 | } else { |
178 | 178 | $whereCond = array('cr_repo_id' => $this->mRepo->getId()); |
179 | 179 | } |
180 | | - $whereCond += $this->getSpecializedWhereClause( $dbr ); |
| 180 | + $whereCond = array_merge( $whereCond, $this->getSpecializedWhereClause( $dbr ) ); |
181 | 181 | return $dbr->selectRow( $tables, $selectFields, $whereCond ); |
182 | 182 | } |
183 | 183 | |