Skip to content
Snippets Groups Projects
Commit 78f72e29 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixed ordering issue

parent ea132292
Branches
No related tags found
No related merge requests found
......@@ -249,7 +249,7 @@ class Database
public function after(int $anchor, int $buffer, int $limit): array
{
$truncatedLimit = max(min($limit + 1, 50), 1);
$truncatedLimit = max(min($limit, 50), 0);
$stmt = $this->backend->loadAfter();
......
......@@ -218,7 +218,7 @@ class PostgresSmartBackend implements Backend
public function loadBefore(): \PDOStatement
{
return $this->db->prepare("
SELECT backlog.messageid,
SELECT * FROM (SELECT backlog.messageid,
backlog.bufferid,
buffer.buffername,
sender.sender,
......@@ -234,7 +234,8 @@ class PostgresSmartBackend implements Backend
AND backlog.bufferid = :bufferid
AND backlog.messageid < :anchor
ORDER BY backlog.messageid DESC
LIMIT :limit;
LIMIT :limit) t
ORDER BY messageid ASC;
");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment