Sqlite doesn't recognize concat() so use || on it instead
This commit is contained in:
parent
2562f89005
commit
7eb5a0877b
|
@ -425,10 +425,16 @@ make_sql_query(User, LServer, MAMQuery, RSM, ExtraUsernames) ->
|
|||
[<<" username in (">>, str:join(EscUsers, <<",">>), <<")">>]};
|
||||
subscribers_table ->
|
||||
SJid = Escape(jid:encode({User, LServer, <<>>})),
|
||||
RoomName = case ODBCType of
|
||||
sqlite ->
|
||||
<<"room || '@' || host">>;
|
||||
_ ->
|
||||
<<"concat(room, '@', host)">>
|
||||
end,
|
||||
{<<" username,">>,
|
||||
[<<" (username = '">>, SUser, <<"'">>,
|
||||
<<" or username in (select concat(room, '@', host) ",
|
||||
"from muc_room_subscribers where jid='">>, SJid, <<"'">>, HostMatch, <<"))">>]};
|
||||
<<" or username in (select ">>, RoomName,
|
||||
<<" from muc_room_subscribers where jid='">>, SJid, <<"'">>, HostMatch, <<"))">>]};
|
||||
_ ->
|
||||
{<<>>, [<<" username='">>, SUser, <<"'">>]}
|
||||
end,
|
||||
|
|
Loading…
Reference in New Issue