server/test/unittest_rql2sql.py
changeset 6493 019ab5eb37ea
parent 6340 470d8e828fda
child 6631 26c303c3f1aa
equal deleted inserted replaced
6492:47a284c0d012 6493:019ab5eb37ea
   568 ORDER BY T1.C2'''),
   568 ORDER BY T1.C2'''),
   569 
   569 
   570     ('Any 1 WHERE X in_group G, X is CWUser',
   570     ('Any 1 WHERE X in_group G, X is CWUser',
   571      '''SELECT 1
   571      '''SELECT 1
   572 FROM in_group_relation AS rel_in_group0'''),
   572 FROM in_group_relation AS rel_in_group0'''),
   573 
       
   574 
       
   575     ]
   573     ]
   576 
   574 
   577 
   575 
   578 MULTIPLE_SEL = [
   576 MULTIPLE_SEL = [
   579     ("DISTINCT Any X,Y where P is Personne, P nom X , P prenom Y;",
   577     ("DISTINCT Any X,Y where P is Personne, P nom X , P prenom Y;",
  1413             ('Any X, FTIRANK(X) WHERE X has_text "toto tata"',
  1411             ('Any X, FTIRANK(X) WHERE X has_text "toto tata"',
  1414              """SELECT appears0.uid, ts_rank(appears0.words, to_tsquery('default', 'toto&tata'))*appears0.weight
  1412              """SELECT appears0.uid, ts_rank(appears0.words, to_tsquery('default', 'toto&tata'))*appears0.weight
  1415 FROM appears AS appears0
  1413 FROM appears AS appears0
  1416 WHERE appears0.words @@ to_tsquery('default', 'toto&tata')"""),
  1414 WHERE appears0.words @@ to_tsquery('default', 'toto&tata')"""),
  1417 
  1415 
       
  1416 
       
  1417             ('Any X WHERE NOT A tags X, X has_text "pouet"',
       
  1418              '''SELECT appears1.uid
       
  1419 FROM appears AS appears1
       
  1420 WHERE NOT (EXISTS(SELECT 1 FROM tags_relation AS rel_tags0 WHERE appears1.uid=rel_tags0.eid_to)) AND appears1.words @@ to_tsquery('default', 'pouet')
       
  1421 '''),
       
  1422 
  1418             )):
  1423             )):
  1419             yield t
  1424             yield t
  1420 
  1425 
  1421 
  1426 
  1422     def test_from_clause_needed(self):
  1427     def test_from_clause_needed(self):