No-result statement check in test_rowcount too strict?

Bug #543885 reported by Max Goodhart
6
This bug affects 1 person
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

Revision history for this message
Vernon Cole (vernondcole) wrote :

Fixed in version 1.14 -- Vernon Cole (kf7xm)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.