server/test/unittest_rql2sql.py
branch3.5
changeset 3238 988a72e59b2b
parent 2920 64322aa83a1d
child 3245 7ef021ac8dec
equal deleted inserted replaced
3237:ee2253f9fbe6 3238:988a72e59b2b
   640 SELECT DISTINCT X.cw_eid AS C0, S.cw_name AS C1
   640 SELECT DISTINCT X.cw_eid AS C0, S.cw_name AS C1
   641 FROM cw_Note AS X, cw_State AS S
   641 FROM cw_Note AS X, cw_State AS S
   642 WHERE X.cw_in_state=S.cw_eid
   642 WHERE X.cw_in_state=S.cw_eid
   643 ORDER BY 2) AS T1'''),
   643 ORDER BY 2) AS T1'''),
   644 
   644 
       
   645     ('Any O,AA,AB,AC ORDERBY AC DESC '
       
   646      'WHERE NOT S use_email O, S eid 1, O is EmailAddress, O address AA, O alias AB, O modification_date AC, '
       
   647      'EXISTS(A use_email O, EXISTS(A identity B, NOT B in_group D, D name "guests", D is CWGroup), A is CWUser), B eid 2',
       
   648      '''SELECT O.cw_eid, O.cw_address, O.cw_alias, O.cw_modification_date
       
   649 FROM cw_EmailAddress AS O
       
   650 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))
       
   651 ORDER BY 4 DESC'''),
   645     ]
   652     ]
   646 
   653 
   647 MULTIPLE_SEL = [
   654 MULTIPLE_SEL = [
   648     ("DISTINCT Any X,Y where P is Personne, P nom X , P prenom Y;",
   655     ("DISTINCT Any X,Y where P is Personne, P nom X , P prenom Y;",
   649      '''SELECT DISTINCT P.cw_nom, P.cw_prenom
   656      '''SELECT DISTINCT P.cw_nom, P.cw_prenom