aboutsummaryrefslogtreecommitdiff
path: root/src/nodetree_tree_sql.erl
diff options
context:
space:
mode:
authorAlexey Shchepin <alexey@process-one.net>2020-01-13 03:36:52 +0300
committerAlexey Shchepin <alexey@process-one.net>2020-02-04 04:53:54 +0300
commitb2f536ec8b40adca1e7c619507116155d6a8497a (patch)
tree0c3c429bea87d6a43e9985a979d7297c5a925b0b /src/nodetree_tree_sql.erl
parentAdd missing oauth_client table declaration in lite.new.sql (diff)
Use SQL ESCAPE statement only with MSSQL and SQLite, improve compatibility with CockroachDB (#3074)
Diffstat (limited to 'src/nodetree_tree_sql.erl')
-rw-r--r--src/nodetree_tree_sql.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nodetree_tree_sql.erl b/src/nodetree_tree_sql.erl
index 2cd208be1..a9e022091 100644
--- a/src/nodetree_tree_sql.erl
+++ b/src/nodetree_tree_sql.erl
@@ -220,12 +220,12 @@ get_subnodes_tree(Host, Node) ->
Rec ->
Type = Rec#pubsub_node.type,
H = node_flat_sql:encode_host(Host),
- N = <<(ejabberd_sql:escape_like_arg_circumflex(Node))/binary, "/%">>,
+ N = <<(ejabberd_sql:escape_like_arg(Node))/binary, "/%">>,
Sub = case catch
ejabberd_sql:sql_query_t(
?SQL("select @(node)s, @(parent)s, @(plugin)s, @(nodeid)d from pubsub_node "
"where host=%(H)s and plugin=%(Type)s and"
- " (parent=%(Node)s or parent like %(N)s escape '^')"))
+ " (parent=%(Node)s or parent like %(N)s %ESCAPE)"))
of
{selected, RItems} ->
[raw_to_node(Host, Item) || Item <- RItems];