#282 cursor.execute sometimes returns 18446744073709551615

MySQLdb (285)

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.


  • 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

    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.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks