Revision 2793
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
290 | 290 |
self._notices_seen.add(msg) |
291 | 291 |
self.log_debug(msg, level=2) |
292 | 292 |
|
293 |
def run_query(self, query, params=None, cacheable=False, log_level=2,
|
|
293 |
def run_query(self, query, cacheable=False, log_level=2, |
|
294 | 294 |
debug_msg_ref=None): |
295 | 295 |
''' |
296 |
@param params Not supported. Use self.esc_value() instead. |
|
297 | 296 |
@param log_ignore_excs The log_level will be increased by 2 if the query |
298 | 297 |
throws one of these exceptions. |
299 | 298 |
@param debug_msg_ref If specified, the log message will be returned in |
... | ... | |
314 | 313 |
try: |
315 | 314 |
# Get cursor |
316 | 315 |
if cacheable: |
317 |
query_lookup = _query_lookup(query, params)
|
|
316 |
query_lookup = _query_lookup(query, [])
|
|
318 | 317 |
try: |
319 | 318 |
cur = self.query_results[query_lookup] |
320 | 319 |
used_cache = True |
... | ... | |
326 | 325 |
self.log_debug(log_msg(query), log_level) |
327 | 326 |
|
328 | 327 |
# Run query |
329 |
cur.execute(query, params)
|
|
328 |
cur.execute(query) |
|
330 | 329 |
finally: |
331 | 330 |
self.print_notices() |
332 | 331 |
if self.debug and debug_msg_ref != None: # return after running |
333 |
debug_msg_ref[0] = log_msg(str(get_cur_query(cur, query, |
|
334 |
params))) |
|
332 |
debug_msg_ref[0] = log_msg(str(get_cur_query(cur, query))) |
|
335 | 333 |
|
336 | 334 |
return cur |
337 | 335 |
|
... | ... | |
410 | 408 |
|
411 | 409 |
try: |
412 | 410 |
try: |
413 |
def run(): return run_raw_query(db, query, [], cacheable,
|
|
414 |
log_level, debug_msg_ref, **kw_args)
|
|
411 |
def run(): return run_raw_query(db, query, cacheable, log_level,
|
|
412 |
debug_msg_ref, **kw_args) |
|
415 | 413 |
if recover and not db.is_cached(query, []): |
416 | 414 |
return with_savepoint(db, run) |
417 | 415 |
else: return run() # don't need savepoint if cached |
Also available in: Unified diff
sql.py: DbConn.run_query(): Removed no longer used params parameter