ImageListPager: Kill that annoying GROUP BY
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 4 Jan 2019 22:09:25 +0000 (17:09 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Fri, 4 Jan 2019 22:38:08 +0000 (17:38 -0500)
commitcd3ee70711a8d7fb69f02989f22b403f86aafb96
tree0405eaf2d01fe7a4f06ce29d562183616fb1614f
parent0405e353694492d231e3af38db3f324c05804c7e
ImageListPager: Kill that annoying GROUP BY

The GROUP BY is broken in later comment migration stages, we just didn't
notice because it's not used when $wgMiserMode is set. Instead of trying
to fix it, yet again, let's just do the count as a subselect.

While this code is being touched, let's also use Database's aliasing
functionality properly instead of passing "foo AS bar" as integer-keyed
values in $fields (with array_search() being used to change them!), and
let's start using Database->addQuotes() for string literals instead of
hard-coding single quotes.

Bug: T212980
Change-Id: Ide7f67893f625fe03127d4a775642cf0a9cca195
includes/specials/pagers/ImageListPager.php