Ticket #3485: db_do_not_format_string.diff
File db_do_not_format_string.diff, 864 bytes (added by , 17 years ago) |
---|
-
util.py
13 13 self.cursor = cursor 14 14 self.db = db 15 15 16 def execute(self, sql, params= ()):16 def execute(self, sql, params=None): 17 17 start = time() 18 18 try: 19 19 return self.cursor.execute(sql, params) 20 20 finally: 21 21 stop = time() 22 # We only try param substitution if have any params 23 if params is not None: 24 sql = smart_unicode(sql) % convert_args(params) 25 else: 26 sql = smart_unicode(sql) 22 27 self.db.queries.append({ 23 'sql': s mart_unicode(sql) % convert_args(params),28 'sql': sql, 24 29 'time': "%.3f" % (stop - start), 25 30 }) 26 31