equal
deleted
inserted
replaced
187 def preprocess(self, union, security=True): |
187 def preprocess(self, union, security=True): |
188 """insert security when necessary then annotate rql st for sql generation |
188 """insert security when necessary then annotate rql st for sql generation |
189 |
189 |
190 return rqlst to actually execute |
190 return rqlst to actually execute |
191 """ |
191 """ |
192 #if server.DEBUG: |
|
193 # print '------- preprocessing', union.as_string('utf8') |
|
194 noinvariant = set() |
192 noinvariant = set() |
195 if security and not self.session.is_super_session: |
193 if security and not self.session.is_super_session: |
196 self._insert_security(union, noinvariant) |
194 self._insert_security(union, noinvariant) |
197 self.rqlhelper.simplify(union) |
195 self.rqlhelper.simplify(union) |
198 self.sqlannotate(union) |
196 self.sqlannotate(union) |
584 |
582 |
585 to maximize the rql parsing/analyzing cache performance, you should |
583 to maximize the rql parsing/analyzing cache performance, you should |
586 always use substitute arguments in queries (eg avoid query such as |
584 always use substitute arguments in queries (eg avoid query such as |
587 'Any X WHERE X eid 123'!) |
585 'Any X WHERE X eid 123'!) |
588 """ |
586 """ |
589 if server.DEBUG: |
587 if server.DEBUG & (server.DBG_RQL | server.DBG_RQL): |
590 print '*'*80 |
588 print '*'*80 |
591 print rql |
589 print 'QUERIER INPUT', rql |
592 # parse the query and binds variables |
590 # parse the query and binds variables |
593 if eid_key is not None: |
591 if eid_key is not None: |
594 if not isinstance(eid_key, (tuple, list)): |
592 if not isinstance(eid_key, (tuple, list)): |
595 eid_key = (eid_key,) |
593 eid_key = (eid_key,) |
596 cachekey = [rql] |
594 cachekey = [rql] |