A free, self-hostable news aggregator…
SQL: Bug with order ASC
Alexandre Alapetite3403af30501c
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.phpindex 301a2ec49..8c001e73b 100644--- a/app/Models/EntryDAO.php+++ b/app/Models/EntryDAO.php@@ -353,7 +353,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {throw new FreshRSS_EntriesGetter_Exception('Bad order in Entry->listByType: [' . $order . ']!');}if ($firstId === '' && parent::$sharedDbType === 'mysql') {- $firstId = '9000000000' . '000000'; //MySQL optimization. Tested on MySQL 5.5 with 150k articles+ $firstId = $order === 'DESC' ? '9000000000'. '000000' : '0'; //MySQL optimization. Tested on MySQL 5.5 with 150k articles}if ($firstId !== '') {$where .= 'AND e1.id ' . ($order === 'DESC' ? '<=' : '>=') . $firstId . ' ';