187 """method called during test to reset potential source caches""" |
187 """method called during test to reset potential source caches""" |
188 self._cache = Cache(self.repo.config['rql-cache-size']) |
188 self._cache = Cache(self.repo.config['rql-cache-size']) |
189 |
189 |
190 def clear_eid_cache(self, eid, etype): |
190 def clear_eid_cache(self, eid, etype): |
191 """clear potential caches for the given eid""" |
191 """clear potential caches for the given eid""" |
192 self._cache.pop('%s X WHERE X eid %s' % (etype, eid), None) |
192 self._cache.pop('Any X WHERE X eid %s, X is %s' % (eid, etype), None) |
193 self._cache.pop('Any X WHERE X eid %s' % eid, None) |
193 self._cache.pop('Any X WHERE X eid %s' % eid, None) |
|
194 self._cache.pop('Any %s' % eid, None) |
194 |
195 |
195 def sqlexec(self, session, sql, args=None): |
196 def sqlexec(self, session, sql, args=None): |
196 """execute the query and return its result""" |
197 """execute the query and return its result""" |
197 return self.process_result(self.doexec(session, sql, args)) |
198 return self.process_result(self.doexec(session, sql, args)) |
198 |
199 |
434 |
435 |
435 def doexec(self, session, query, args=None): |
436 def doexec(self, session, query, args=None): |
436 """Execute a query. |
437 """Execute a query. |
437 it's a function just so that it shows up in profiling |
438 it's a function just so that it shows up in profiling |
438 """ |
439 """ |
439 if server.DEBUG: |
|
440 print 'exec', query, args |
|
441 cursor = session.pool[self.uri] |
440 cursor = session.pool[self.uri] |
442 if server.DEBUG & server.DBG_SQL: |
441 if server.DEBUG & server.DBG_SQL: |
443 print 'exec', query, args, session.pool.connection(self.uri)._cnx |
442 print 'exec', query, args, session.pool.connection(self.uri)._cnx |
444 try: |
443 try: |
445 # str(query) to avoid error if it's an unicode string |
444 # str(query) to avoid error if it's an unicode string |