Navigation Menu

Skip to content

Commit

Permalink
2.34.3 Group by and date fixes for MySQL 8.0 - not live yet, but vagr…
Browse files Browse the repository at this point in the history
…ant default
  • Loading branch information
Martin Francis committed Feb 19, 2022
1 parent a48a22c commit cb2c0d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Repository/SignalRepository.php
Expand Up @@ -1047,7 +1047,7 @@ public function getListenersForSignal($signalID, array $args)
->andWhere('li.id = l.listenerId')
->andWhere('s.id = :signalID')
->setParameter(':signalID', $signalID)
->addGroupBy('li.id');
->addGroupBy('li.id, l.dxKm, l.dxMiles');

$this->addSimpleLimit($qb, $args);
$this->addSimpleSort($qb, $args, $this->signalListenersColumns);
Expand Down Expand Up @@ -1100,11 +1100,11 @@ private function addSimpleSort($qb, $args, $refColumns)
{
$idx = $refColumns[$args['sort']];
if (isset($idx['sort'])) {
$qb->addSelect('CASE WHEN ' . $idx['sort'] . ' IS NULL OR ' . $idx['sort'] . ' = \'\' THEN 1 ELSE 0 END AS N1');
$qb->addSelect('CASE WHEN ' . $idx['sort'] . ' IS NULL THEN 1 ELSE 0 END AS N1');
$qb->addOrderBy('N1', 'ASC');
$qb->addOrderBy($idx['sort'], ('d' === $args['order'] ? 'DESC' : 'ASC'));
if (isset($idx['sort_2'])) {
$qb->addSelect('CASE WHEN ' . $idx['sort_2'] . ' IS NULL OR ' . $idx['sort_2'] . ' = \'\' THEN 1 ELSE 0 END AS N2');
$qb->addSelect('CASE WHEN ' . $idx['sort_2'] . ' IS NULL THEN 1 ELSE 0 END AS N2');
$qb->addOrderBy('N2', 'ASC');
$qb->addOrderBy($idx['sort_2'], ('d' === $args['order'] ? 'DESC' : 'ASC'));
}
Expand Down

0 comments on commit cb2c0d6

Please sign in to comment.