worldveil / dejavu

Audio fingerprinting and recognition in Python
MIT License
6.36k stars 1.43k forks source link

mysql error 2014 - commands out of sync - conn.ping #194

Closed milahu closed 4 years ago

milahu commented 5 years ago

this error occurs, when Cursor.__init__ is trying to use a cached connection

mysql_exceptions.ProgrammingError: (2014, "Commands out of sync; you can't run this command now")

at conn.ping(True) in database_sql.py

solution: remove the call conn.ping(True), and the program works anyway

earlier, the same error occured at self.conn.autocommit(False) but now its working ....

guess: SQLDatabase.setup is running in background, locking the connection cursor. contradiction: the Cursor.__exit__ function does close the cursor ....

env: mariadb 10.3.14 reconnect patch for mariadb, so we can build mysql-python: sed '/st_mysql_options options;/a unsigned int reconnect;' /usr/include/mysql/mysql.h -i.bak python 2.7.16 mysql-python 1.2.3c1