aboutsummaryrefslogtreecommitdiff
path: root/src/node_flat_sql.erl
diff options
context:
space:
mode:
authorMickael Remond <mremond@process-one.net>2016-11-09 09:04:58 +0100
committerMickael Remond <mremond@process-one.net>2016-11-09 09:04:58 +0100
commit42bede77a1a36c6bbc1ce3c2728e8c3dd78eb5f2 (patch)
tree677c46157270f24a40200ebb21beb5ba0397d358 /src/node_flat_sql.erl
parentExpose unregister API command (diff)
parentSupport several groups separated by ; in add_rosteritem command (diff)
Merge branch 'master' of github.com:processone/ejabberd
Diffstat (limited to 'src/node_flat_sql.erl')
-rw-r--r--src/node_flat_sql.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_flat_sql.erl b/src/node_flat_sql.erl
index 15cf9b37a..61156ee06 100644
--- a/src/node_flat_sql.erl
+++ b/src/node_flat_sql.erl
@@ -688,7 +688,7 @@ get_items(Nidx, _From,
before -> {<<">">>, <<"asc">>};
_ -> {<<"is not">>, <<"desc">>}
end,
- SNidx = integer_to_binary(Nidx),
+ SNidx = jlib:i2l(Nidx),
[AttrName, Id] = case I of
undefined when IncIndex =/= undefined ->
case catch
@@ -790,7 +790,7 @@ get_items(Nidx, JID, AccessModel, PresenceSubscription, RosterGroup, _SubId, RSM
get_last_items(Nidx, _From, Count) ->
Limit = jlib:i2l(Count),
- SNidx = integer_to_binary(Nidx),
+ SNidx = jlib:i2l(Nidx),
Query = fun(mssql, _) ->
ejabberd_sql:sql_query_t(
[<<"select top ">>, Limit,
@@ -890,7 +890,7 @@ del_items(Nidx, [ItemId]) ->
del_item(Nidx, ItemId);
del_items(Nidx, ItemIds) ->
I = str:join([[<<"'">>, ejabberd_sql:escape(X), <<"'">>] || X <- ItemIds], <<",">>),
- SNidx = integer_to_binary(Nidx),
+ SNidx = jlib:i2l(Nidx),
catch
ejabberd_sql:sql_query_t([<<"delete from pubsub_item where itemid in (">>,
I, <<") and nodeid='">>, SNidx, <<"';">>]).