HomePhabricator

Group query results under the "ANCESTOR" operator unconditionally

Description

Group query results under the "ANCESTOR" operator unconditionally

Summary:
Fixes T12753. See that task for reproduction instructions.

We add a GROUP BY clause to queries with an "ANCESTOR" edge constraint only if the constaint has more than one PHID, but this is incorrect: the same row can be found twice by an ANCESTOR query if task T is tagged with both "B" and "C", children of "A", and the user queries for "tasks in A".

Instead, always add GROUP BY for ANCESTOR queries.

Test Plan:

  • Followed test plan in T12753.
  • Saw proper paging controls after change.
  • Saw GROUP BY in DarkConsole.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12753

Differential Revision: https://secure.phabricator.com/D18012