API: Fix list=allusers with multiple values for augroup
authorBrad Jorsch <bjorsch@wikimedia.org>
Sat, 6 Sep 2014 19:25:11 +0000 (15:25 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Fri, 12 Sep 2014 13:24:29 +0000 (09:24 -0400)
commitaa5800519f301cbafa835ef3ee95c7b3f24050b4
tree9f924f425e757fb641505f1c4717609f3bdb4104
parentc55116b808ba938e075d738a91515d2a7ab6b67d
API: Fix list=allusers with multiple values for augroup

The existing query only works with a single value for augroup, or mostly
if it's combined with auprop=groups or auprop=rights (since most users
don't have every possible group).

When used with multiple values for augroup, it will raise an error if it
happens to encounter enough users who have more than one of the
specified groups. And further, it will lead to repeated groups for these
users if combined with auprop=groups or auprop=rights.

To avoid both these issues, let's use EXISTS instead of a JOIN to test
augroup. While auexcludegroup doesn't have this problem, we may as well
make the same change there, too. And doing that, there's no reason to
continue with an error when both augroup and auexcludegroup are used.

Bug: 70496
Change-Id: Ia7086ce87012c22651ac4c7a3f75558347276226
includes/api/ApiQueryAllUsers.php