Просмотр исходного кода

Work around

In the current SQL request with LIMIT, if many dates are identical, the
pagination may not work properly. Added a little more tolerance, but
will have to be solved better.
Alexandre Alapetite 12 лет назад
Родитель
Сommit
040e72fe4f
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      app/models/Entry.php

+ 1 - 1
app/models/Entry.php

@@ -396,7 +396,7 @@ class EntryDAO extends Model_pdo {
 		     . ' ORDER BY date' . $order . ', id' . $order;
 		     . ' ORDER BY date' . $order . ', id' . $order;
 
 
 		if (!empty($limitCount)) {
 		if (!empty($limitCount)) {
-			$sql .= ' LIMIT ' . ($limitCount + 1);	//TODO: See http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/
+			$sql .= ' LIMIT ' . ($limitCount + 2);	//TODO: See http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/
 		}
 		}
 
 
 		$stm = $this->bd->prepare ($sql);
 		$stm = $this->bd->prepare ($sql);