cursor.execute sometimes returns 18446744073709551615
MySQL database connector for Python programming
Brought to you by:
adustman
the cursor.execute method sometimes returns 18446744073709551615 when an error occurs during the execution of a SQL statement. in our case, we were executing a SELECT query. the MySQLdb implementation of the affected_rows method converts a unsigned long long to a python long. when mysql_affected_rows returns (my_ulonglong)-1, the MySQLdb converts this to 18446744073709551615.
It would be nice if the MySQLdb affected_rows method returns a -1 rather than this positive integer.
patch to _mysql.c affected_rows method
Can you give me a test case (example SELECT) so I can repro this and add it to our test suite? What type of SELECT error triggers this without throwing an exception?
Hello
We are building a new MySQL storage engine, which handles locks differently than other storage engines. In some cases, we return a lock timeout error to the user.