From d120e0ad91b5398340d532b4da3f59acd556ff39 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Wed, 27 Sep 2017 11:12:01 +0200 Subject: [PATCH] PubSub: add correct order when requesting all items --- src/node_flat_sql.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_flat_sql.erl b/src/node_flat_sql.erl index 110e31092..0f9a64731 100644 --- a/src/node_flat_sql.erl +++ b/src/node_flat_sql.erl @@ -651,7 +651,8 @@ get_items(Nidx, _From, undefined) -> SNidx = misc:i2l(Nidx), case ejabberd_sql:sql_query_t( [<<"select itemid, publisher, creation, modification, payload", - " from pubsub_item where nodeid='", SNidx/binary, "'">>]) of + " from pubsub_item where nodeid='", SNidx/binary, "'", + " order by creation asc">>]) of {selected, _, AllItems} -> Count = length(AllItems), if Count =< ?MAXITEMS ->