You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, and hell if I can figure it out, when attempting to populate the stored procedures thanatos is tossing the following error: ProgrammingError: (2014, "Commands out of sync; you can't run this command now")
Repro code:
>>>fromthanatos.databaseimportdb_utils>>>db_conn=db_utils.get_connection()
>>>db_utils.update_sql_stored_procs(db_conn)
Traceback (mostrecentcalllast):
File"<input>", line1, in<module>File"D:\projects\evetrivia\thanatos\thanatos\database\db_utils.py", line55, inupdate_sql_stored_procsexecute_sql(sql, db_connection, fetch=None)
File"D:\projects\evetrivia\thanatos\thanatos\database\db_utils.py", line21, inexecute_sqlcursor.execute(sql)
File"D:\projects\evetrivia\thanatos\env\lib\site-packages\MySQLdb\cursors.py", line222, inexecuteifnotself._defer_warnings: self._warning_check()
File"D:\projects\evetrivia\thanatos\env\lib\site-packages\MySQLdb\cursors.py", line112, in_warning_checkwarnings=self._get_db().show_warnings()
File"D:\projects\evetrivia\thanatos\env\lib\site-packages\MySQLdb\connections.py", line369, inshow_warningsself.query("SHOW WARNINGS")
File"D:\projects\evetrivia\thanatos\env\lib\site-packages\MySQLdb\connections.py", line280, inquery_mysql.connection.query(self, query)
ProgrammingError: (2014, "Commands out of sync; you can't run this command now")
Each time the code is run 1 stored proc will be stored in the DB. So if you run it once and then check the DBs stored procs 1 will be there. If you run it a second time there will be 2. So on and so on. If you run it enough times it will complete entirely and stop throwing an error.
Seems this is related to dropping a procedure that does not exist. Have opened an issue with mysqlclient to see why the exception is not more accurate. Will have some thing about how to handle this in Thanatos.
For some reason, and hell if I can figure it out, when attempting to populate the stored procedures thanatos is tossing the following error:
ProgrammingError: (2014, "Commands out of sync; you can't run this command now")
Repro code:
Everything I can find online indicates this error is caused by trying to execute more SQL code on a cursor before closing it and getting a new one. See here: http://eric.lubow.org/2009/python/pythons-mysqldb-2014-error-commands-out-of-sync/
However thanatos is specifically closing the cursor after execution of SQL code. See: https://github.com/evetrivia/thanatos/blob/master/thanatos/database/db_utils.py#L32
The hell is this crap. :(
The text was updated successfully, but these errors were encountered: