HAVING sql clause don't know about comma... stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 03 Jun 2010 16:47:57 +0200
branchstable
changeset 5662 785837baabba
parent 5661 84ef08bbda3c
child 5665 1b5d9ec38c1b
HAVING sql clause don't know about comma...
server/sources/rql2sql.py
--- a/server/sources/rql2sql.py	Thu Jun 03 16:37:01 2010 +0200
+++ b/server/sources/rql2sql.py	Thu Jun 03 16:47:57 2010 +0200
@@ -556,8 +556,8 @@
                                   if not isinstance(vref, Constant))
             if having:
                 # filter out constants as for GROUP BY
-                having = ','.join(vref.accept(self) for vref in having
-                                  if not isinstance(vref, Constant))
+                having = ' AND '.join(term.accept(self) for term in having
+                                      if not isinstance(term, Constant))
             if needwrap:
                 sql = '%s FROM (%s) AS T1' % (self._selection_sql(outerselection, distinct,
                                                                   needalias),