Revision e98c5561 snf-pithos-backend/pithos/backends/lib/sqlalchemy/node.py

b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/node.py
1109 1109
        s = s.where(self.versions.c.node.in_(select([self.nodes.c.node],
1110 1110
                                        self.nodes.c.parent == parent)))
1111 1111

  
1112
        s = s.where(self.versions.c.node == self.versions.c.node)
1112
        s = s.where(self.versions.c.node == self.nodes.c.node)
1113 1113
        s = s.where(and_(self.nodes.c.path > bindparam('start'), self.nodes.c.path < nextling))
1114
        conj = []
1114
        conja = []
1115
        conjb = []
1115 1116
        for path, match in pathq:
1116 1117
            if match == MATCH_PREFIX:
1117
                conj.append(self.nodes.c.path.like(self.escape_like(path) + '%',
1118
                conja.append(self.nodes.c.path.like(self.escape_like(path) + '%',
1118 1119
                                          escape=ESCAPE_CHAR))
1119 1120
            elif match == MATCH_EXACT:
1120
                conj.append(self.nodes.c.path == path)
1121
        if conj:
1122
            s = s.where(or_(*conj))
1121
                conjb.append(path)
1122
        if conja or conjb:
1123
            s = s.where(and_(self.nodes.c.path.in_(conjb),*conja))
1123 1124

  
1124 1125
        if sizeq and len(sizeq) == 2:
1125 1126
            if sizeq[0]:

Also available in: Unified diff