server/test/unittest_msplanner.py
changeset 8219 fb61698f93fc
parent 8111 d1be698018d2
child 8544 3d049071957e
equal deleted inserted replaced
8218:0725e3b81442 8219:fb61698f93fc
   912                    [('FetchStep', [('Any E WHERE E type "X", E is Note', [{'E': 'Note'}])],
   912                    [('FetchStep', [('Any E WHERE E type "X", E is Note', [{'E': 'Note'}])],
   913                      [self.cards, self.system],  None, {'E': 'table1.C0'}, []),
   913                      [self.cards, self.system],  None, {'E': 'table1.C0'}, []),
   914                     ('FetchStep', [('Any X WHERE X is CWUser', [{'X': 'CWUser'}])],
   914                     ('FetchStep', [('Any X WHERE X is CWUser', [{'X': 'CWUser'}])],
   915                      [self.ldap, self.system], None, {'X': 'table2.C0'}, []),
   915                      [self.ldap, self.system], None, {'X': 'table2.C0'}, []),
   916                     ('UnionFetchStep', [
   916                     ('UnionFetchStep', [
   917                         ('FetchStep', [('Any X WHERE EXISTS(X owned_by %s), X is Basket' % ueid, [{'X': 'Basket'}])],
   917                         ('FetchStep', [('Any X WHERE EXISTS(%s use_email X), X is EmailAddress' % ueid,
       
   918       [{'X': 'EmailAddress'}]),
       
   919                                        ('Any X WHERE EXISTS(X owned_by %s), X is Basket' % ueid, [{'X': 'Basket'}])],
   918                           [self.system], {}, {'X': 'table0.C0'}, []),
   920                           [self.system], {}, {'X': 'table0.C0'}, []),
   919                         ('UnionFetchStep',
   921                         ('UnionFetchStep',
   920                          [('FetchStep', [('Any X WHERE X is IN(Card, Note, State)',
   922                          [('FetchStep', [('Any X WHERE X is IN(Card, Note, State)',
   921                                           [{'X': 'Card'}, {'X': 'Note'}, {'X': 'State'}])],
   923                                           [{'X': 'Card'}, {'X': 'Note'}, {'X': 'State'}])],
   922                            [self.cards, self.system], {}, {'X': 'table0.C0'}, []),
   924                            [self.cards, self.system], {}, {'X': 'table0.C0'}, []),
   923                           ('FetchStep',
   925                           ('FetchStep',
   924                            [('Any X WHERE X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWSource, CWUniqueTogetherConstraint, Comment, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Old, Personne, RQLExpression, Societe, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)',
   926                            [('Any X WHERE X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWSource, CWUniqueTogetherConstraint, Comment, Division, Email, EmailPart, EmailThread, ExternalUri, File, Folder, Old, Personne, RQLExpression, Societe, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)',
   925                              [{'X': 'BaseTransition'}, {'X': 'Bookmark'},
   927                              [{'X': 'BaseTransition'}, {'X': 'Bookmark'},
   926                               {'X': 'CWAttribute'}, {'X': 'CWCache'},
   928                               {'X': 'CWAttribute'}, {'X': 'CWCache'},
   927                               {'X': 'CWConstraint'}, {'X': 'CWConstraintType'},
   929                               {'X': 'CWConstraint'}, {'X': 'CWConstraintType'},
   928                               {'X': 'CWEType'}, {'X': 'CWGroup'},
   930                               {'X': 'CWEType'}, {'X': 'CWGroup'},
   929                               {'X': 'CWPermission'}, {'X': 'CWProperty'},
   931                               {'X': 'CWPermission'}, {'X': 'CWProperty'},
   930                               {'X': 'CWRType'}, {'X': 'CWRelation'},
   932                               {'X': 'CWRType'}, {'X': 'CWRelation'},
   931                               {'X': 'CWSource'},
   933                               {'X': 'CWSource'},
   932                               {'X': 'CWUniqueTogetherConstraint'},
   934                               {'X': 'CWUniqueTogetherConstraint'},
   933                               {'X': 'Comment'}, {'X': 'Division'},
   935                               {'X': 'Comment'}, {'X': 'Division'},
   934                               {'X': 'Email'}, {'X': 'EmailAddress'},
   936                               {'X': 'Email'},
   935                               {'X': 'EmailPart'}, {'X': 'EmailThread'},
   937                               {'X': 'EmailPart'}, {'X': 'EmailThread'},
   936                               {'X': 'ExternalUri'}, {'X': 'File'},
   938                               {'X': 'ExternalUri'}, {'X': 'File'},
   937                               {'X': 'Folder'}, {'X': 'Old'},
   939                               {'X': 'Folder'}, {'X': 'Old'},
   938                               {'X': 'Personne'}, {'X': 'RQLExpression'},
   940                               {'X': 'Personne'}, {'X': 'RQLExpression'},
   939                               {'X': 'Societe'}, {'X': 'SubDivision'},
   941                               {'X': 'Societe'}, {'X': 'SubDivision'},
   970                     ('FetchStep', [('Any E WHERE E type "X", E is Note', [{'E': 'Note'}])],
   972                     ('FetchStep', [('Any E WHERE E type "X", E is Note', [{'E': 'Note'}])],
   971                      [self.cards, self.system],  None, {'E': 'table2.C0'}, []),
   973                      [self.cards, self.system],  None, {'E': 'table2.C0'}, []),
   972                     ('FetchStep', [('Any X WHERE X is CWUser', [{'X': 'CWUser'}])],
   974                     ('FetchStep', [('Any X WHERE X is CWUser', [{'X': 'CWUser'}])],
   973                      [self.ldap, self.system], None, {'X': 'table3.C0'}, []),
   975                      [self.ldap, self.system], None, {'X': 'table3.C0'}, []),
   974                     ('UnionFetchStep',
   976                     ('UnionFetchStep',
   975                      [('FetchStep', [('Any ET,X WHERE X is ET, EXISTS(X owned_by %s), ET is CWEType, X is Basket' % ueid,
   977                      [('FetchStep', [('Any ET,X WHERE X is ET, EXISTS(%s use_email X), ET is CWEType, X is EmailAddress' % ueid,
       
   978       [{'ET': 'CWEType', 'X': 'EmailAddress'}]), ('Any ET,X WHERE X is ET, EXISTS(X owned_by %s), ET is CWEType, X is Basket' % ueid,
   976                                       [{'ET': 'CWEType', 'X': 'Basket'}])],
   979                                       [{'ET': 'CWEType', 'X': 'Basket'}])],
   977                        [self.system], {}, {'ET': 'table0.C0', 'X': 'table0.C1'}, []),
   980                        [self.system], {}, {'ET': 'table0.C0', 'X': 'table0.C1'}, []),
   978                       ('FetchStep', [('Any ET,X WHERE X is ET, (EXISTS(X owned_by %(ueid)s)) OR ((((EXISTS(D concerne C?, C owned_by %(ueid)s, C type "X", X identity D, C is Division, D is Affaire)) OR (EXISTS(H concerne G?, G owned_by %(ueid)s, G type "X", X identity H, G is SubDivision, H is Affaire))) OR (EXISTS(I concerne F?, F owned_by %(ueid)s, F type "X", X identity I, F is Societe, I is Affaire))) OR (EXISTS(J concerne E?, E owned_by %(ueid)s, X identity J, E is Note, J is Affaire))), ET is CWEType, X is Affaire' % {'ueid': ueid},
   981                       ('FetchStep', [('Any ET,X WHERE X is ET, (EXISTS(X owned_by %(ueid)s)) OR ((((EXISTS(D concerne C?, C owned_by %(ueid)s, C type "X", X identity D, C is Division, D is Affaire)) OR (EXISTS(H concerne G?, G owned_by %(ueid)s, G type "X", X identity H, G is SubDivision, H is Affaire))) OR (EXISTS(I concerne F?, F owned_by %(ueid)s, F type "X", X identity I, F is Societe, I is Affaire))) OR (EXISTS(J concerne E?, E owned_by %(ueid)s, X identity J, E is Note, J is Affaire))), ET is CWEType, X is Affaire' % {'ueid': ueid},
   979                                       [{'C': 'Division', 'E': 'Note', 'D': 'Affaire',
   982                                       [{'C': 'Division', 'E': 'Note', 'D': 'Affaire',
   980                                         'G': 'SubDivision', 'F': 'Societe', 'I': 'Affaire',
   983                                         'G': 'SubDivision', 'F': 'Societe', 'I': 'Affaire',
   985                       ('FetchStep', [('Any ET,X WHERE X is ET, EXISTS(X owned_by %s), ET is CWEType, X is CWUser' % ueid,
   988                       ('FetchStep', [('Any ET,X WHERE X is ET, EXISTS(X owned_by %s), ET is CWEType, X is CWUser' % ueid,
   986                                       [{'ET': 'CWEType', 'X': 'CWUser'}])],
   989                                       [{'ET': 'CWEType', 'X': 'CWUser'}])],
   987                        [self.system], {'X': 'table3.C0'}, {'ET': 'table0.C0', 'X': 'table0.C1'}, []),
   990                        [self.system], {'X': 'table3.C0'}, {'ET': 'table0.C0', 'X': 'table0.C1'}, []),
   988                       # extra UnionFetchStep could be avoided but has no cost, so don't care
   991                       # extra UnionFetchStep could be avoided but has no cost, so don't care
   989                       ('UnionFetchStep',
   992                       ('UnionFetchStep',
   990                        [('FetchStep', [('Any ET,X WHERE X is ET, ET is CWEType, X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWSource, CWUniqueTogetherConstraint, Comment, Division, Email, EmailAddress, EmailPart, EmailThread, ExternalUri, File, Folder, Old, Personne, RQLExpression, Societe, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)',
   993                        [('FetchStep', [('Any ET,X WHERE X is ET, ET is CWEType, X is IN(BaseTransition, Bookmark, CWAttribute, CWCache, CWConstraint, CWConstraintType, CWEType, CWGroup, CWPermission, CWProperty, CWRType, CWRelation, CWSource, CWUniqueTogetherConstraint, Comment, Division, Email, EmailPart, EmailThread, ExternalUri, File, Folder, Old, Personne, RQLExpression, Societe, SubDivision, SubWorkflowExitPoint, Tag, TrInfo, Transition, Workflow, WorkflowTransition)',
   991                                         [{'X': 'BaseTransition', 'ET': 'CWEType'},
   994                                         [{'X': 'BaseTransition', 'ET': 'CWEType'},
   992                                          {'X': 'Bookmark', 'ET': 'CWEType'}, {'X': 'CWAttribute', 'ET': 'CWEType'},
   995                                          {'X': 'Bookmark', 'ET': 'CWEType'}, {'X': 'CWAttribute', 'ET': 'CWEType'},
   993                                          {'X': 'CWCache', 'ET': 'CWEType'}, {'X': 'CWConstraint', 'ET': 'CWEType'},
   996                                          {'X': 'CWCache', 'ET': 'CWEType'}, {'X': 'CWConstraint', 'ET': 'CWEType'},
   994                                          {'X': 'CWConstraintType', 'ET': 'CWEType'},
   997                                          {'X': 'CWConstraintType', 'ET': 'CWEType'},
   995                                          {'X': 'CWEType', 'ET': 'CWEType'},
   998                                          {'X': 'CWEType', 'ET': 'CWEType'},
   998                                          {'X': 'CWSource', 'ET': 'CWEType'},
  1001                                          {'X': 'CWSource', 'ET': 'CWEType'},
   999                                          {'X': 'CWRelation', 'ET': 'CWEType'},
  1002                                          {'X': 'CWRelation', 'ET': 'CWEType'},
  1000                                          {'X': 'CWUniqueTogetherConstraint', 'ET': 'CWEType'},
  1003                                          {'X': 'CWUniqueTogetherConstraint', 'ET': 'CWEType'},
  1001                                          {'X': 'Comment', 'ET': 'CWEType'},
  1004                                          {'X': 'Comment', 'ET': 'CWEType'},
  1002                                          {'X': 'Division', 'ET': 'CWEType'}, {'X': 'Email', 'ET': 'CWEType'},
  1005                                          {'X': 'Division', 'ET': 'CWEType'}, {'X': 'Email', 'ET': 'CWEType'},
  1003                                          {'X': 'EmailAddress', 'ET': 'CWEType'}, {'X': 'EmailPart', 'ET': 'CWEType'},
  1006                                          {'X': 'EmailPart', 'ET': 'CWEType'},
  1004                                          {'X': 'EmailThread', 'ET': 'CWEType'}, {'X': 'ExternalUri', 'ET': 'CWEType'},
  1007                                          {'X': 'EmailThread', 'ET': 'CWEType'}, {'X': 'ExternalUri', 'ET': 'CWEType'},
  1005                                          {'X': 'File', 'ET': 'CWEType'}, {'X': 'Folder', 'ET': 'CWEType'},
  1008                                          {'X': 'File', 'ET': 'CWEType'}, {'X': 'Folder', 'ET': 'CWEType'},
  1006                                          {'X': 'Old', 'ET': 'CWEType'}, {'X': 'Personne', 'ET': 'CWEType'},
  1009                                          {'X': 'Old', 'ET': 'CWEType'}, {'X': 'Personne', 'ET': 'CWEType'},
  1007                                          {'X': 'RQLExpression', 'ET': 'CWEType'}, {'X': 'Societe', 'ET': 'CWEType'},
  1010                                          {'X': 'RQLExpression', 'ET': 'CWEType'}, {'X': 'Societe', 'ET': 'CWEType'},
  1008                                          {'X': 'SubDivision', 'ET': 'CWEType'}, {'X': 'SubWorkflowExitPoint', 'ET': 'CWEType'},
  1011                                          {'X': 'SubDivision', 'ET': 'CWEType'}, {'X': 'SubWorkflowExitPoint', 'ET': 'CWEType'},