executemany fails when passing a list of dicts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mysqldb (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: python-mysqldb
using the table:
-------
create table a(f1 int, f2 int);
and the python code:
-------
import MySQLdb
conn = MySQLdb.
cursor = conn.cursor()
vals = [{'f1' : 1, 'f2' : 2}]
sql = "insert into a values (%(f1)s, %(f2)s)"
print MySQLdb.__version__
cursor.execute(sql, vals[0])
print "execute works"
cursor.
print "execute many works"
gives the result:
-------
1.2.2
execute works
Traceback (most recent call last):
File "test.py", line 11, in <module>
cursor.
File "/usr/lib/
self.
File "/usr/lib/
raise errorclass, errorvalue
ValueError: incomplete format
but should give:
-------
1.2.2
execute works
execute many works
This version has expired