Continue cleaning up queries in the wake of changes to "%Q"

Summary: Depends on D19810. Ref T13217. Ref T13216. I mostly used `grep implode | grep OR` and `grep implode | grep AND` to find these -- not totally exhaustive but should be a big chunk of the callsites that are missing `%LO` / `%LA`.

Test Plan:
These are tricky to test exhaustively, but I made an attempt to hit most of them:

- Browsed Almanac interfaces.
- Created/browsed Calendar events.
- Enabled/disabled/showed the lock log.
- Browsed repositories.
- Loaded Facts UI.
- Poked at Multimeter.
- Used typeahead for users and projects.
- Browsed Phriction.
- Ran various fulltext searches.

Not sure these are reachable:

- All the lint stuff might be dead/unreachable/nonfunctional?

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: yelirekim

Maniphest Tasks: T13217, T13216

Differential Revision: https://secure.phabricator.com/D19814
This commit is contained in:
epriestley
2018-11-15 05:53:34 -08:00
parent 49483bdb48
commit 933462b487
15 changed files with 59 additions and 44 deletions

View File

@@ -276,13 +276,13 @@ final class DiffusionLintController extends DiffusionController {
array_keys($branch),
$path->getPath());
if ($path->getExcluded()) {
$where[] = 'NOT '.$condition;
$where[] = qsprintf($conn, 'NOT %Q', $condition);
} else {
$or[] = $condition;
}
}
}
$where[] = '('.implode(' OR ', $or).')';
$where[] = qsprintf($conn, '%LO', $or);
}
return queryfx_all(
@@ -296,11 +296,11 @@ final class DiffusionLintController extends DiffusionController {
COUNT(DISTINCT path) AS files,
COUNT(*) AS n
FROM %T
WHERE %Q
WHERE %LA
GROUP BY branchID, code
ORDER BY n DESC',
PhabricatorRepository::TABLE_LINTMESSAGE,
implode(' AND ', $where));
$where);
}
protected function buildActionView(DiffusionRequest $drequest) {
@@ -526,10 +526,10 @@ final class DiffusionLintController extends DiffusionController {
$conn,
'SELECT *
FROM %T
WHERE %Q
WHERE %LA
ORDER BY path, code, line LIMIT %d OFFSET %d',
PhabricatorRepository::TABLE_LINTMESSAGE,
implode(' AND ', $where),
$where,
$limit,
$offset);
}