ANY_VALUE in mod/admin

The query was not standard, not deterministic, and was not doing what
its description says. The patch makes it more standard and a bit more
deterministic. The returned protocol type is still undeterministic.
This commit is contained in:
Alexandre Alapetite 2017-04-15 23:42:10 +02:00
rodič 062070058e
revize 8b3f623d29
1 změnil soubory, kde provedl 2 přidání a 1 odebrání

Zobrazit soubor

@ -290,7 +290,8 @@ function admin_page_federation(App $a) {
foreach ($platforms as $p) {
// get a total count for the platform, the name and version of the
// highest version and the protocol tpe
$c = qu('SELECT COUNT(*) AS `total`, `platform`, `network`, `version` FROM `gserver`
$c = qu('SELECT COUNT(*) AS `total`, ANY_VALUE(`platform`),
ANY_VALUE(`network`), MAX(`version`) FROM `gserver`
WHERE `platform` LIKE "%s" AND `last_contact` >= `last_failure`
ORDER BY `version` ASC;', $p);
$total = $total + $c[0]['total'];