This bug causes MySQLdb to fail to detect any primary key by the test prescribed by the DB API 2.0, namely to test cursor.description[icol]==MySQLdb.ROWID. On all the platforms I've checked so far (Mac OS X, linux), MySQLdb.ROWID appears to be empty, which explains why the test always fails!
By contrast, other datatypes have a defined set of possible values:
DBAPISet([253, 254, 247])
This bug therefore causes the officially prescribed test for a primary key to always fail. Using MySQLdb will therefore lead to the erroneous indication that all tables in any MySQL database lack a primary key! That is a serious problem, and a big departure from what is prescribed in PEP 249.
I searched the sourceforge tracker for any report with the keyword ROWID and found nothing. I suspect this bug has been ignored because a developer can just use MySQL's "describe foo" SQL command to detect a primary key. However, this is non-portable and breaks the whole purpose of the DB API to provide a portable interface to many types of databases. By failing to implement the PEP 249 prescribed ROWID type test, this bug forces developers to write non-portable code.
It would be easy to add support for the ROWID capability, by using MySQL's "describe foo" command and looking for columns with Key="PRI" value.
MySQLdb version: 1.2.2.final
MySQL version: 5.0.38
Python version: 2.5.2
OS: Mac OS 10.5.2
CPU: Intel penryn