[rql2sql] fix in 7394:d11d88bd08e8 was actually not needed stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 19 May 2011 10:35:20 +0200
branchstable
changeset 7396 8345ee2c2ea6
parent 7395 09ffcc04bd21
child 7397 6a9e66d788b3
child 7401 fded980bbd65
[rql2sql] fix in 7394:d11d88bd08e8 was actually not needed
server/sources/rql2sql.py
server/test/unittest_rql2sql.py
--- a/server/sources/rql2sql.py	Thu May 19 09:43:23 2011 +0200
+++ b/server/sources/rql2sql.py	Thu May 19 10:35:20 2011 +0200
@@ -1023,9 +1023,6 @@
             # attribute relation
             if rtype == 'has_text':
                 sql = self._visit_has_text_relation(relation)
-            elif rtype == 'eid':
-                sql =  '%s%s' % (relation.children[0].variable.accept(self),
-                                 relation.children[1].accept(self))
             else:
                 rhs_vars = rhs.get_nodes(VariableRef)
                 if rhs_vars:
--- a/server/test/unittest_rql2sql.py	Thu May 19 09:43:23 2011 +0200
+++ b/server/test/unittest_rql2sql.py	Thu May 19 10:35:20 2011 +0200
@@ -631,7 +631,12 @@
     ("Personne X,Y where X nom NX, Y nom NX, X eid XE, not Y eid XE",
      '''SELECT _X.cw_eid, _Y.cw_eid
 FROM cw_Personne AS _X, cw_Personne AS _Y
-WHERE _Y.cw_nom=_X.cw_nom AND NOT (_Y.cw_eid=_X.cw_eid)''')
+WHERE _Y.cw_nom=_X.cw_nom AND NOT (_Y.cw_eid=_X.cw_eid)'''),
+
+    ('Any X,Y WHERE X is Personne, Y is Personne, X nom XD, Y nom XD, X eid Z, Y eid > Z',
+     '''SELECT _X.cw_eid, _Y.cw_eid
+FROM cw_Personne AS _X, cw_Personne AS _Y
+WHERE _Y.cw_nom=_X.cw_nom AND _Y.cw_eid>_X.cw_eid'''),
     ]