aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryuriyz-w <65344339+yuriyz-w@users.noreply.github.com>2020-05-15 10:19:55 +0300
committerGitHub <noreply@github.com>2020-05-15 09:19:55 +0200
commit44528d3fef1d0a380af5b4d5c709484a64494eee (patch)
tree67b20f3b7b1b60416da6429afed2d9fa74abd620 /src
parentIncrease default shaper limits, to help with jingle initiation delay (diff)
Make SQL query more generic for MSSQL compatibility (#3271)
Diffstat (limited to 'src')
-rw-r--r--src/node_flat_sql.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_flat_sql.erl b/src/node_flat_sql.erl
index 05cfa12b3..461c701aa 100644
--- a/src/node_flat_sql.erl
+++ b/src/node_flat_sql.erl
@@ -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)}