cubicweb/server/querier.py
changeset 12834 492e1e0bbc6c
parent 12759 ec834074ea25
child 12835 1fd029f11dc4
equal deleted inserted replaced
12833:c69421aece24 12834:492e1e0bbc6c
    35 from cubicweb.debug import emit_to_debug_channel
    35 from cubicweb.debug import emit_to_debug_channel
    36 
    36 
    37 from cubicweb.utils import QueryCache, RepeatList
    37 from cubicweb.utils import QueryCache, RepeatList
    38 from cubicweb.misc.source_highlight import highlight_terminal
    38 from cubicweb.misc.source_highlight import highlight_terminal
    39 from cubicweb.server.rqlannotation import SQLGenAnnotator, set_qdata
    39 from cubicweb.server.rqlannotation import SQLGenAnnotator, set_qdata
    40 from cubicweb.server.ssplanner import READ_ONLY_RTYPES, add_types_restriction
    40 from cubicweb.server.ssplanner import (READ_ONLY_RTYPES, add_types_restriction,
       
    41                                        SSPlanner)
    41 from cubicweb.server.edition import EditedEntity
    42 from cubicweb.server.edition import EditedEntity
    42 from cubicweb.server.ssplanner import SSPlanner
       
    43 from cubicweb.statsd_logger import statsd_timeit, statsd_c
    43 from cubicweb.statsd_logger import statsd_timeit, statsd_c
    44 
    44 
    45 ETYPE_PYOBJ_MAP[Binary] = 'Bytes'
    45 ETYPE_PYOBJ_MAP[Binary] = 'Bytes'
    46 
    46 
    47 
    47 
   189             result = step.execute()
   189             result = step.execute()
   190         # the latest executed step contains the full query result
   190         # the latest executed step contains the full query result
   191         return result
   191         return result
   192 
   192 
   193     def preprocess(self, union, security=True):
   193     def preprocess(self, union, security=True):
   194         """insert security when necessary then annotate rql st for sql generation
   194         """insert security when necessary then annotate rql syntax tree
   195 
   195         to prepare sql generation
   196         return rqlst to actually execute
       
   197         """
   196         """
   198         cached = None
   197         cached = None
   199         if security and self.cnx.read_security:
   198         if security and self.cnx.read_security:
   200             # ensure security is turned of when security is inserted,
   199             # ensure security is turned off when security is inserted,
   201             # else we may loop for ever...
   200             # else we may loop for ever...
   202             if self.cnx.transaction_data.get('security-rqlst-cache'):
   201             if self.cnx.transaction_data.get('security-rqlst-cache'):
   203                 key = self.cache_key
   202                 key = self.cache_key
   204             else:
   203             else:
   205                 key = None
   204                 key = None