From 58866a76fa60c3829b2083fa92f2198825195769 Mon Sep 17 00:00:00 2001 From: adustman Date: Sat, 15 Jun 2002 23:38:54 +0000 Subject: [PATCH] Make executemany iterate over queries that don't use multiple VALUES --- MySQLdb/MySQLdb/cursors.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MySQLdb/MySQLdb/cursors.py b/MySQLdb/MySQLdb/cursors.py index aa52f02..44cfe07 100644 --- a/MySQLdb/MySQLdb/cursors.py +++ b/MySQLdb/MySQLdb/cursors.py @@ -106,7 +106,11 @@ class BaseCursor: from string import join m = insert_values.search(query) - if not m: raise ProgrammingError, "can't find values" + if not m: + r = 0 + for a in args: + r = r + self.execute(query, a) + return r p = m.start(1) qv = query[p:] qargs = self.connection.literal(args)