server/test/unittest_rql2sql.py
changeset 11293 63c589e6b076
parent 11033 63d860a14a17
equal deleted inserted replaced
11289:3e69bccc2022 11293:63c589e6b076
   572         X cw_schema X_CW_SCHEMA,
   572         X cw_schema X_CW_SCHEMA,
   573         X owned_by X_OWNED_BY?
   573         X owned_by X_OWNED_BY?
   574     ''', '''SELECT _X.cw_eid
   574     ''', '''SELECT _X.cw_eid
   575 FROM cw_CWSourceSchemaConfig AS _X LEFT OUTER JOIN owned_by_relation AS rel_owned_by1 ON (rel_owned_by1.eid_from=_X.cw_eid)
   575 FROM cw_CWSourceSchemaConfig AS _X LEFT OUTER JOIN owned_by_relation AS rel_owned_by1 ON (rel_owned_by1.eid_from=_X.cw_eid)
   576 WHERE EXISTS(SELECT 1 FROM created_by_relation AS rel_created_by0, cw_CWUser AS _U WHERE rel_created_by0.eid_from=_X.cw_eid AND rel_created_by0.eid_to=_U.cw_eid) AND _X.cw_cw_schema IS NOT NULL
   576 WHERE EXISTS(SELECT 1 FROM created_by_relation AS rel_created_by0, cw_CWUser AS _U WHERE rel_created_by0.eid_from=_X.cw_eid AND rel_created_by0.eid_to=_U.cw_eid) AND _X.cw_cw_schema IS NOT NULL
   577 ''')
   577 '''),
   578     ]
   578 
       
   579     ('Any X WHERE EXISTS(X in_state S, S name "state name"), X is in (Affaire, Note)',
       
   580      '''SELECT _X.cw_eid
       
   581 FROM cw_Affaire AS _X
       
   582 WHERE EXISTS(SELECT 1 FROM cw_State AS _S WHERE _X.cw_in_state=_S.cw_eid AND _S.cw_name=state name)
       
   583 UNION ALL
       
   584 SELECT _X.cw_eid
       
   585 FROM cw_Note AS _X
       
   586 WHERE EXISTS(SELECT 1 FROM cw_State AS _S WHERE _X.cw_in_state=_S.cw_eid AND _S.cw_name=state name)'''),
       
   587 
       
   588 ]
   579 
   589 
   580 ADVANCED_WITH_GROUP_CONCAT = [
   590 ADVANCED_WITH_GROUP_CONCAT = [
   581         ("Any X,GROUP_CONCAT(TN) GROUPBY X ORDERBY XN WHERE T tags X, X name XN, T name TN, X is CWGroup",
   591         ("Any X,GROUP_CONCAT(TN) GROUPBY X ORDERBY XN WHERE T tags X, X name XN, T name TN, X is CWGroup",
   582      '''SELECT _X.cw_eid, GROUP_CONCAT(_T.cw_name)
   592      '''SELECT _X.cw_eid, GROUP_CONCAT(_T.cw_name)
   583 FROM cw_CWGroup AS _X, cw_Tag AS _T, tags_relation AS rel_tags0
   593 FROM cw_CWGroup AS _X, cw_Tag AS _T, tags_relation AS rel_tags0