aboutsummaryrefslogtreecommitdiff
path: root/src/node_flat.erl
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2021-06-10 20:21:44 +0200
committerBadlop <badlop@process-one.net>2021-06-14 12:22:37 +0200
commit4ee10c155d753890e508596f65c8fb24140e1290 (patch)
treee5e99b367de2b858c0ca021529b87184f35d5698 /src/node_flat.erl
parentAdd mqtt_pub table definition for MSSQL (#3097) (diff)
Fix reverse order of items when using <before/> in Pubsub with RSM (#3621)
Diffstat (limited to 'src/node_flat.erl')
-rw-r--r--src/node_flat.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_flat.erl b/src/node_flat.erl
index 5c34f5fdb..4a2a60971 100644
--- a/src/node_flat.erl
+++ b/src/node_flat.erl
@@ -758,12 +758,12 @@ get_items(Nidx, _From, #rsm_set{max = Max, index = IncIndex,
{_, <<>>, undefined} ->
%% 2.5 Requesting the Last Page in a Result Set
SubList = lists:reverse(RItems),
- {Count, lists:sublist(SubList, Limit)};
+ {Count-Limit, lists:reverse(lists:sublist(SubList, Limit))};
{_, Stamp, undefined} ->
BeforeNow = encode_stamp(Stamp),
{NewIndex, SubList} = extract_sublist(before_now, BeforeNow,
0, lists:reverse(RItems)),
- {Count-NewIndex-1, lists:sublist(SubList, Limit)};
+ {Count-NewIndex-Limit, lists:reverse(lists:sublist(SubList, Limit))};
{_, undefined, Stamp} ->
AfterNow = encode_stamp(Stamp),
{NewIndex, SubList} = extract_sublist(after_now, AfterNow,