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

Open
anandology opened this Issue Nov 29, 2010 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

anandology commented Nov 29, 2010

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

https://bugs.launchpad.net/webpy/+bug/672538

 

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

Contributor

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