summaryrefslogtreecommitdiff
path: root/bin/sql_db.py
diff options
context:
space:
mode:
authorced <>2007-10-11 05:19:56 +0000
committerced <>2007-10-11 05:19:56 +0000
commit7affbc505b0367e9034dbc8c368e38f73349fe8d (patch)
treecb1906142edb2c25361b1217c93efcb3e0497847 /bin/sql_db.py
parent08e5155f2cf0f502ad74afdecb25bd4534088ace (diff)
Why is it there ????
bzr revid: ced-8e946c402962a6253c9f199537b7d1fa97ee1663
Diffstat (limited to 'bin/sql_db.py')
-rw-r--r--bin/sql_db.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/bin/sql_db.py b/bin/sql_db.py
index 21f66a28d2d..91457922b31 100644
--- a/bin/sql_db.py
+++ b/bin/sql_db.py
@@ -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=()