Skip to content

Commit

Permalink
Ensure static result in GROUP_CONCAT
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Jul 3, 2024
1 parent 43ad4bf commit f542b92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/DataAccess/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getInvalidatedArchiveIdsSafeToDelete($archiveTable, $setGroupCon
}

$sql = "SELECT idsite, date1, date2, period, name,
GROUP_CONCAT(idarchive, '.', value ORDER BY ts_archived DESC) as archives
GROUP_CONCAT(idarchive, '.', value ORDER BY ts_archived DESC, idarchive DESC) as archives
FROM `$archiveTable`
WHERE name LIKE 'done%'
AND `value` NOT IN (" . ArchiveWriter::DONE_ERROR . ")
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/Integration/DataAccess/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testGetInvalidatedArchiveIdsSafeToDeleteHandlesCutOffGroupMaxLen

// sanity check
$table = ArchiveTableCreator::getNumericTable(Date::factory('2020-02-03'));
$sql = "SELECT GROUP_CONCAT(idarchive, '.', value ORDER BY ts_archived DESC) as archives
$sql = "SELECT GROUP_CONCAT(idarchive, '.', value ORDER BY ts_archived DESC, idarchive DESC) as archives
FROM `$table`
GROUP BY idsite, date1, date2, period, name";
$result = Db::fetchRow($sql);
Expand Down

0 comments on commit f542b92

Please sign in to comment.