Multiple queries using db.query() raises a ProgrammingError #34

anandology opened this Issue Nov 29, 2010 · 1 comment


None yet
2 participants

anandology commented Nov 29, 2010

Reported on Launchpad by by Brian J Ewing on 2010-11-08.


db.query("INSERT INTO table1 (field1, field2) VALUES ('value', 'value');" +
    " UPDATE table2 SET foo='bar'")

This works fine, however a _mysql_exceptions.ProgrammingError is raised:

_mysql_exceptions.ProgrammingError: (2014, 
    "Commands out of sync; you can't run this command now") 
in <bound method Cursor.__del__ of <MySQLdb.cursors.Cursor object at 0x>>

db.query tries to return the result from the last query without first freeing the result of the first, and MySQLdb raises this exception


aaronsw commented Apr 11, 2011

Why would you do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment