HomePhabricator

Fix unique-users query

Authored by Catrope.

Description

Fix unique-users query

The way it was using GROUP BY was breaking things somehow.
This may have been related to rev_user_ip being NULL for
logged-in users, or maybe GROUP BY is just weird.

COUNT(DISTINCT rev_user_id, rev_user_ip, rev_user_wiki) also doesn't
work because that drops any row where any of those fields is NULL;
but COALESCE()ing the nullable field fixes that.

Bonus: Renamed fields to readable names, and fixed
weekstart value to be the actual day the week starts (Sunday),
rather than the day before (Saturday) which isn't even part of
the week in question!

Bug: T106564
Change-Id: I3d08c7d6b7367103aacf1c906ebe62da9dc99759

Details