summaryrefslogtreecommitdiff
path: root/bin/sql_db.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sql_db.py')
-rw-r--r--bin/sql_db.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/bin/sql_db.py b/bin/sql_db.py
index 005d66fec53..af57255fb56 100644
--- a/bin/sql_db.py
+++ b/bin/sql_db.py
@@ -48,9 +48,9 @@ class fake_cursor:
self.con = con
self.dbname = dbname
- def execute_dont_run(self,*args):
- if not fake_cursor.nbr % 100:
- print 'sql: ',fake_cursor.nbr
+ 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)
@@ -62,15 +62,15 @@ class fake_cursor:
# else:
# print 'sql: ',fake_cursor.nbr, args[0]
- if not fake_cursor.nbr % 5000:
- 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 not fake_cursor.nbr % 5000:
+ # 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]