Menu

#282 cursor.execute sometimes returns 18446744073709551615

open
MySQLdb (285)
5
2012-09-19
2009-05-12
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

  • richard prohaska

    patch to _mysql.c affected_rows method

     
  • Kyle VanderBeek

    Kyle VanderBeek - 2009-05-18

    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?

     
  • richard prohaska

    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.

     

Log in to post a comment.