diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2016-06-22 13:25:41 +0300 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2016-06-22 13:25:41 +0300 |
commit | 95ff94b0549d30c3be26f266f4bf1094c9927500 (patch) | |
tree | 55ddd4149c145c631e3b1e97dd05065deb8b4f02 | |
parent | 77443393475b9b4733b286b49fa72c52b73a79a6 (diff) |
Fix PubSub RSM on get_items (#1147)
-rw-r--r-- | src/node_flat_sql.erl | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/node_flat_sql.erl b/src/node_flat_sql.erl index 7b8ee552c..0869f531c 100644 --- a/src/node_flat_sql.erl +++ b/src/node_flat_sql.erl @@ -686,13 +686,10 @@ get_items(Nidx, _From, #rsm_in{max = M, direction = Direction, id = I, index = IncIndex}) -> Max = ejabberd_sql:escape(jlib:i2l(M)), {Way, Order} = case Direction of - % aft -> {<<"<">>, <<"desc">>}; - % before when I == <<>> -> {<<"is not">>, <<"asc">>}; - % before -> {<<">">>, <<"asc">>}; - % _ when IncIndex =/= undefined -> - % {<<"<">>, <<"desc">>}; % using index - _ -> - {<<"is not">>, <<"desc">>}% Can be better + aft when I == <<>> -> {<<"is not">>, <<"desc">>}; + aft -> {<<"<">>, <<"desc">>}; + before when I == <<>> -> {<<"is not">>, <<"asc">>}; + before -> {<<">">>, <<"asc">>} end, SNidx = integer_to_binary(Nidx), [AttrName, Id] = case I of |