I'm executing a transaction from about 15 machines to a mysql server using python.
Some of these queries return -1 on cursor.execute()
Since there is no exception thrown, I'm unable to determine the reason.
I looked through cursors.py, connections.py and it seems that cursor.execute() is returning the result of get_affected_rows() in the C api. however, it seems that if a mysql error is encountered during the query, before get_affected_rows() is called, MySQLdb should raise an exception as that is what the default error handler does.
I ran the same scenario in perl (with DBI) and it returns an error.
DBD::mysql::st execute failed: Lock wait timeout exceeded; try restarting transaction at /scripts/db.pl line 16.
DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /scripts/db.pl line 19.
somehow, the python bindings seem to not give this error. at other times, i have seen this error from python bindings, the only difference this time is i'm using transactions.