mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-24 17:29:28 +01:00
Make SQL query more generic for MSSQL compatibility (#3271)
This commit is contained in:
parent
4580feaa3c
commit
44528d3fef
@ -897,12 +897,12 @@ select_affiliation_subscriptions(Nidx, GenKey, SubKey) ->
|
||||
GJ = encode_jid(GenKey),
|
||||
SJ = encode_jid(SubKey),
|
||||
case catch ejabberd_sql:sql_query_t(
|
||||
?SQL("select jid = %(GJ)s as @(G)b, @(affiliation)s, @(subscriptions)s from "
|
||||
?SQL("select @(jid)s, @(affiliation)s, @(subscriptions)s from "
|
||||
" pubsub_state where nodeid=%(Nidx)d and jid in (%(GJ)s, %(SJ)s)"))
|
||||
of
|
||||
{selected, Res} ->
|
||||
lists:foldr(
|
||||
fun({true, A, S}, {_, Subs}) ->
|
||||
fun({Jid, A, S}, {_, Subs}) when Jid == GJ ->
|
||||
{decode_affiliation(A), Subs ++ decode_subscriptions(S)};
|
||||
({_, _, S}, {Aff, Subs}) ->
|
||||
{Aff, Subs ++ decode_subscriptions(S)}
|
||||
|
Loading…
Reference in New Issue
Block a user