Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Open
anandology opened this Issue · 1 comment

2 participants

@anandology
Collaborator

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

@aaronsw
Owner

Why would you do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.