diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2020-03-18 14:31:13 +0100 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2020-03-18 14:31:13 +0100 |
commit | 039d786e1f91a4c703edee7a532a77c0273b09a1 (patch) | |
tree | e54576b1687c665d720d7422b03dd1c216744012 /src | |
parent | Fix type of computed field in node_flat sql query (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/ejabberd_sql.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ejabberd_sql.erl b/src/ejabberd_sql.erl index a04acbcad..87679f60b 100644 --- a/src/ejabberd_sql.erl +++ b/src/ejabberd_sql.erl @@ -740,7 +740,7 @@ pgsql_escape() -> (false) -> <<"'f'">> 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) -> |