25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

Add escape '\' to like expression in pgsql to fix problem cockroachdb

Cockroachdb doesn't properly handle escaping of _ in like expressions,
having "like ... escape '\'" makes it work, by disabling optimization that
causes this broken behaviour
This commit is contained in:
Paweł Chmielowski 2020-03-18 14:31:13 +01:00
parent 2d707cc0d2
commit 039d786e1f

View File

@ -740,7 +740,7 @@ pgsql_escape() ->
(false) -> <<"'f'">> (false) -> <<"'f'">>
end, end,
in_array_string = fun(X) -> <<"E'", (escape(X))/binary, "'">> end, in_array_string = fun(X) -> <<"E'", (escape(X))/binary, "'">> end,
like_escape = fun() -> <<"">> end like_escape = fun() -> <<"ESCAPE E'\\\\'">> end
}. }.
sqlite_sql_query(SQLQuery) -> sqlite_sql_query(SQLQuery) ->