No-result statement check in test_rowcount too strict?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python DBAPI Compliance Tests |
New
|
Undecided
|
Unassigned |
Bug Description
In test_rowcount() on line 324, it is expected that executing DDL1 (a CREATE statement) will result in a rowcount of -1.
On the rowcount property, PEP 249 states:
The attribute is -1 in case no .execute*() has been
performed on the cursor or the rowcount of the last
operation is cannot be determined by the interface. [7]
For some database client libraries, this CREATE statement results in an affected row count of 0. This is the case for MySQLdb and libdrizzle. Since the row count of the CREATE statement can be determined by the client library, it seems reasonable that a DB-API module could return 0. I would suggest updating the test to allow a rowcount of either -1 or 0 in that case.
-C
Fixed in version 1.14 -- Vernon Cole (kf7xm)