classification
Title: sqlite3 documentation on rowcount is contradictory
Type: Stage:
Components: Documentation Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ghaering Nosy List: georg.brandl, ghaering, sanxiyn
Priority: low Keywords:

Created on 2006-10-09 16:18 by sanxiyn, last changed 2007-08-23 20:40 by georg.brandl. This issue is now closed.

Messages (3)
msg30192 - (view) Author: Seo Sanghyeon (sanxiyn) Date: 2006-10-09 16:18
http://docs.python.org/lib/sqlite3-Cursor-Objects.html
says:

----
For SELECT statements, rowcount is always None because
we cannot determine the number of rows a query produced
until all rows were fetched.

As required by the Python DB API Spec, the rowcount
attribute "is -1 in case no executeXX() has been
performed on the cursor or the rowcount of the last
operation is not determinable by the interface".
----

Clearly, both can't be true. My experiment showed that
rowcount is set to -1, not None. I suggest rewriting
this to something like:

----
As required by the Python DB API Spec, the rowcount
attribute "is -1 in case no executeXX() has been
performed on the cursor or the rowcount of the last
operation is not determinable by the interface".

This includes SELECT statements, because we cannot
determine the number of rows a query produced until all
rows are fetched.
----
msg30193 - (view) Author: Gerhard Häring (ghaering) * (Python committer) Date: 2006-10-10 10:04
Logged In: YES 
user_id=163326

Thanks for the bug report. I will perform the suggested 
change.
msg55207 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-08-23 20:40
Fixed now in rev. 57345.
History
Date User Action Args
2007-08-23 20:40:11georg.brandlsetstatus: open -> closed
nosy: + georg.brandl
resolution: fixed
messages: + msg55207
2006-10-09 16:18:03sanxiyncreate