]> granicus.if.org Git - ejabberd/commitdiff
Quote reserver 'type' keyword for pgsql to fix e300f80
authorChristophe Romain <christophe.romain@process-one.net>
Tue, 5 Jul 2016 14:16:40 +0000 (16:16 +0200)
committerChristophe Romain <christophe.romain@process-one.net>
Tue, 5 Jul 2016 14:16:40 +0000 (16:16 +0200)
src/nodetree_tree_sql.erl

index fb5141bf3363e73b26349dfa3cc4645862a5286f..edfdbc1d5f5404693ea02742652c933bc58d9c75 100644 (file)
@@ -202,7 +202,7 @@ get_subnodes_tree(Host, Node) ->
                ?SQL("select @(node)s, @(parent)s, @(type)s, @(nodeid)d from "
                    "pubsub_node where host=%(H)s"
                    " and node like %(N)s escape '^'"
-                   " and type='hometree'"))
+                   " and \"type\"='hometree'"))
            of
                {selected, RItems} ->
                    [raw_to_node(Host, Item) || Item <- RItems];
@@ -264,7 +264,7 @@ delete_node(Host, Node) ->
     catch ejabberd_sql:sql_query_t(
             ?SQL("delete from pubsub_node where host=%(H)s"
                " and (node=%(Node)s"
-                 " or (type = 'hometree' and node like %(N)s escape '^'))")),
+                 " or (\"type\"='hometree' and node like %(N)s escape '^'))")),
     Removed.
 
 %% helpers