aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-07-17 11:56:15 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-07-17 11:56:15 +0200
commit3403af30501cc0df75290372bc111430e0f8e70a (patch)
tree7b4e7b6460788521565ed7372c587177f3e76e45 /app/Models/EntryDAO.php
parent5d7deb6d254a304c88c3c7969113127b48f76ef9 (diff)
SQL: Bug with order ASC
https://github.com/marienfressinaud/FreshRSS/issues/538
Diffstat (limited to 'app/Models/EntryDAO.php')
-rw-r--r--app/Models/EntryDAO.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 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 . ' ';