Multiple queries using db.query() raises a _mysql_exceptions.ProgrammingError

Bug #672538 reported by Brian J Ewing
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
web.py
Fix Released
Undecided
Unassigned

Bug Description

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

Revision history for this message
Anand Chitipothu (anandology) wrote :
Revision history for this message
Anand Chitipothu (anandology) wrote :

This issue is moved to github.

https://github.com/webpy/webpy/issues/issue/34

Changed in webpy:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.