[rql2sql] test we don't crash on dumb queries stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 09 Oct 2009 19:19:30 +0200
branchstable
changeset 3632 874f5a73e89f
parent 3631 6176ef2f6488
child 3633 2d81178bea5f
[rql2sql] test we don't crash on dumb queries
server/test/unittest_rql2sql.py
--- a/server/test/unittest_rql2sql.py	Fri Oct 09 16:48:03 2009 +0200
+++ b/server/test/unittest_rql2sql.py	Fri Oct 09 19:19:30 2009 +0200
@@ -566,6 +566,15 @@
 FROM cw_EmailAddress AS O
 WHERE NOT EXISTS(SELECT 1 FROM use_email_relation AS rel_use_email0 WHERE rel_use_email0.eid_from=1 AND rel_use_email0.eid_to=O.cw_eid) AND EXISTS(SELECT 1 FROM use_email_relation AS rel_use_email1 WHERE rel_use_email1.eid_to=O.cw_eid AND EXISTS(SELECT 1 FROM cw_CWGroup AS D WHERE rel_use_email1.eid_from=2 AND NOT EXISTS(SELECT 1 FROM in_group_relation AS rel_in_group2 WHERE rel_in_group2.eid_from=2 AND rel_in_group2.eid_to=D.cw_eid) AND D.cw_name=guests))
 ORDER BY 4 DESC'''),
+
+
+    ("Any X WHERE X eid 0, X eid 0",
+     '''SELECT 0'''),
+
+    ("Any X WHERE X eid 0, X eid 0, X test TRUE",
+     '''SELECT X.cw_eid
+FROM cw_Personne AS X
+WHERE X.cw_eid=0 AND X.cw_eid=0 AND X.cw_test='''),
     ]
 
 MULTIPLE_SEL = [