--- 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'''),
]