aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2017-03-21 12:45:11 +0100
committerChristophe Romain <christophe.romain@process-one.net>2017-03-21 12:45:41 +0100
commit70050b52ad2312fe11f4ffec9389757fc82833c8 (patch)
treecf4ad838cd10ef2f2acc842962d1b6e1caf7404b
parentMerge pull request #1626 from weiss/fix-scram-import (diff)
Use item creation date in rsm order (#1516)
-rw-r--r--src/node_flat_sql.erl16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/node_flat_sql.erl b/src/node_flat_sql.erl
index d3294cc68..e47f119ed 100644
--- a/src/node_flat_sql.erl
+++ b/src/node_flat_sql.erl
@@ -673,20 +673,20 @@ get_items(Nidx, _From, #rsm_set{max = Max, index = IncIndex,
case I of
undefined when IncIndex =/= undefined ->
case ejabberd_sql:sql_query_t(
- [<<"select modification from pubsub_item pi "
+ [<<"select creation from pubsub_item pi "
"where exists ( select count(*) as count1 "
"from pubsub_item where nodeid='">>, SNidx,
- <<"' and modification > pi.modification having count1 = ">>,
+ <<"' and creation > pi.creation having count1 = ">>,
integer_to_binary(IncIndex), <<" );">>]) of
{selected, [_], [[O]]} ->
- [<<"modification">>, <<"'", O/binary, "'">>];
+ [<<"creation">>, <<"'", O/binary, "'">>];
_ ->
- [<<"modification">>, <<"null">>]
+ [<<"creation">>, <<"null">>]
end;
undefined ->
- [<<"modification">>, <<"null">>];
+ [<<"creation">>, <<"null">>];
<<>> ->
- [<<"modification">>, <<"null">>];
+ [<<"creation">>, <<"null">>];
I ->
[A, B] = str:tokens(ejabberd_sql:escape(I), <<"@">>),
[A, <<"'", B/binary, "'">>]
@@ -729,8 +729,8 @@ get_items(Nidx, _From, #rsm_set{max = Max, index = IncIndex,
index = Index,
first = #rsm_first{
index = Index,
- data = <<"modification@", F/binary>>},
- last = <<"modification@", L/binary>>},
+ data = <<"creation@", F/binary>>},
+ last = <<"creation@", L/binary>>},
{result, {[raw_to_item(Nidx, RItem) || RItem <- RItems], RsmOut}};
[] ->
{result, {[], #rsm_set{count = Count}}}