[stcheck] remove overzealous check (closes #240176)
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 23 Apr 2014 13:59:02 +0200
changeset 731 4239093674fe
parent 730 e82edc0de3de
child 732 be1d0045f2e3
[stcheck] remove overzealous check (closes #240176) Allow multiple (non "=") operators for uid variables.
stcheck.py
test/unittest_stcheck.py
--- a/stcheck.py	Mon May 12 16:21:39 2014 +0200
+++ b/stcheck.py	Wed Apr 23 13:59:02 2014 +0200
@@ -375,7 +375,7 @@
                 if rschema.final and relation.optional not in (None, 'right'):
                      state.error("optional may only be set on the rhs on final relation `%s`"
                                  % relation.r_type)
-                if self.special_relations.get(rtype) == 'uid':
+                if self.special_relations.get(rtype) == 'uid' and relation.operator() == '=':
                     if state.var_info.get(lhsvar, 0) & VAR_HAS_UID_REL:
                         state.error('can only one uid restriction per variable '
                                     '(use IN for %s if desired)' % lhsvar.name)
--- a/test/unittest_stcheck.py	Mon May 12 16:21:39 2014 +0200
+++ b/test/unittest_stcheck.py	Wed Apr 23 13:59:02 2014 +0200
@@ -81,6 +81,8 @@
     'DISTINCT Any P ORDERBY PN WHERE P work_for X, P name PN',
     'DISTINCT Any P ORDERBY XN WHERE P work_for X, X name XN',
 
+    'Any X WHERE X eid > 0, X eid < 42',
+    'Any X WHERE X eid 1, X eid < 42',
 
 
     )