Why is it there ????

bzr revid: ced-8e946c402962a6253c9f199537b7d1fa97ee1663
This commit is contained in:
ced
2007-10-11 05:19:56 +00:00
parent 08e5155f2c
commit 7affbc505b
-32
View File
@@ -57,38 +57,6 @@ class fake_cursor:
self.con = con
self.dbname = dbname
def execute(self,*args):
#if not fake_cursor.nbr % 1:
# print 'sql: ',fake_cursor.nbr, args
res = re.match('^select.* from ([a-zA-Z_]+) .*$', args[0], re.I)
if res:
fake_cursor._tables.setdefault(res.group(1), 0)
fake_cursor._tables[res.group(1)] += 1
#else:
# if len(args)>1:
# print 'sql: ',fake_cursor.nbr, args[0], args[1]
# else:
# print 'sql: ',fake_cursor.nbr, args[0]
if not fake_cursor.nbr % 500:
ct = []
for t,c in fake_cursor._tables.items():
ct.append([c,t])
ct.sort()
ct.reverse()
print 'After %d queries' % (fake_cursor.nbr,)
for line in ct[:50]:
print ' %s: %d' % (line[1], line[0])
#if len(args)>1:
# print 'sql: ',fake_cursor.nbr, args[0], args[1]
#else:
# print 'sql: ',fake_cursor.nbr, args[0]
fake_cursor.nbr += 1
return self.obj.execute(*args)
def execute(self, sql, params=None):
if not params:
params=()