[Python-checkins] cpython (merge 3.2 -> default): Merge branch '3.2'
petri.lehtinen
python-checkins at python.org
Thu Feb 16 20:47:32 CET 2012
http://hg.python.org/cpython/rev/08699214f79b
changeset: 74989:08699214f79b
parent: 74986:f2ee5d65dcdb
parent: 74987:74b2da95c6be
user: Petri Lehtinen <petri at digip.org>
date: Thu Feb 16 21:43:41 2012 +0200
summary:
Merge branch '3.2'
Closes #13995.
files:
Doc/includes/sqlite3/shortcut_methods.py | 3 +--
Doc/library/sqlite3.rst | 11 +++++------
Misc/NEWS | 4 ++--
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/Doc/includes/sqlite3/shortcut_methods.py b/Doc/includes/sqlite3/shortcut_methods.py
--- a/Doc/includes/sqlite3/shortcut_methods.py
+++ b/Doc/includes/sqlite3/shortcut_methods.py
@@ -17,5 +17,4 @@
for row in con.execute("select firstname, lastname from person"):
print(row)
-# Using a dummy WHERE clause to not let SQLite take the shortcut table deletes.
-print("I just deleted", con.execute("delete from person where 1=1").rowcount, "rows")
+print("I just deleted", con.execute("delete from person").rowcount, "rows")
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -555,18 +555,17 @@
attribute, the database engine's own support for the determination of "rows
affected"/"rows selected" is quirky.
- For ``DELETE`` statements, SQLite reports :attr:`rowcount` as 0 if you make a
- ``DELETE FROM table`` without any condition.
-
For :meth:`executemany` statements, the number of modifications are summed up
into :attr:`rowcount`.
As required by the Python DB API Spec, the :attr:`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".
+ 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 were fetched.
- This includes ``SELECT`` statements because we cannot determine the number of
- rows a query produced until all rows were fetched.
+ With SQLite versions before 3.6.5, :attr:`rowcount` is set to 0 if
+ you make a ``DELETE FROM table`` without any condition.
.. attribute:: Cursor.lastrowid
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2258,8 +2258,8 @@
Documentation
-------------
-- Issue #13491: Fix many errors in sqlite3 documentation. Initial
- patch by Johannes Vogel.
+- Issues #13491 and #13995: Fix many errors in sqlite3 documentation.
+ Initial patch for #13491 by Johannes Vogel.
- Issue #13402: Document absoluteness of sys.executable.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list