[rql2sql] added test that shows crash during sql generation
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 20 Jan 2010 10:05:10 +0100
changeset 4275 1084aaa53a25
parent 4274 4601ba407ed6
child 4282 149b33d22d87
[rql2sql] added test that shows crash during sql generation Original query in cubicweb-drh: Any A,E,CV,group_concat(TN) GROUPBY A,E,CV WHERE A is Application, A for_person P, P has_studied_in E?, T? tags A, T name TN, A curriculum CV? Corresponding bug in tracker: #628798
server/test/unittest_rql2sql.py
--- a/server/test/unittest_rql2sql.py	Tue Jan 19 18:26:22 2010 +0100
+++ b/server/test/unittest_rql2sql.py	Wed Jan 20 10:05:10 2010 +0100
@@ -1581,6 +1581,10 @@
 FROM (SELECT 1) AS _T
 WHERE EXISTS(SELECT 1 FROM owned_by_relation AS rel_owned_by0, cw_Affaire AS _P WHERE rel_owned_by0.eid_from=_P.cw_eid AND rel_owned_by0.eid_to=1 UNION SELECT 1 FROM owned_by_relation AS rel_owned_by1, cw_Note AS _P WHERE rel_owned_by1.eid_from=_P.cw_eid AND rel_owned_by1.eid_to=1)''')
 
+    def test_groupby_multiple_outerjoins(self):
+        self._check('Any A,U,P,group_concat(TN) GROUPBY A,U,P WHERE A is Affaire, A concerne N, N todo_by U?, T? tags A, T name TN, A todo_by P?',
+                    "SHOULD NOT CRASH")
+
 
 class removeUnsusedSolutionsTC(TestCase):
     def test_invariant_not_varying(self):