I'm getting a very strange error while using MySQLdb in Bottle on PythonAnywhere.com
Whenever the execute contains columns of type int, decimal or datetime, the execute throws a 500 error. For example, from a table Tools, manufacturer and sub_type are both varchars, so this block of code works perfectly:
reservation_id = request.forms.get("reservation_id")
db = MySQLdb.connect("...")
c = db.cursor()
c.execute("""SELECT manufacturer, sub_type FROM Tool""")
row = c.fetchone()
return row
But ask for the tool_id from that same table, which is of int type, or any other column of int, decimal or datetime type from that table:
reservation_id = request.forms.get("reservation_id")
db = MySQLdb.connect("...")
c = db.cursor()
c.execute("""SELECT tool_id FROM Tool""")
row = c.fetchone()
return row
And Bottle throws a critical error:
Error running WSGI application SystemError: returned a result with an error set
In MySQL bash, every query works perfectly. Put that same query (only int, decimal or datetime) in execute(), and it fails.
Has anyone had any similar experience?