Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#282 cursor.execute sometimes returns 18446744073709551615

open
MySQLdb (285)
5
2012-09-19
2009-05-12
richard prohaska
No

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.

Discussion

  • patch to _mysql.c affected_rows method

     
    Attachments
  • 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.