From: Erlend E. Aasland Date: Thu, 11 May 2023 09:09:46 +0000 (+0200) Subject: [3.11] gh-101117: Improve accuracy of sqlite3.Cursor.rowcount docs (#104287) (#104381) X-Git-Tag: v3.11.4~86 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=705508850026dd13121b469290e27c29bd8ef20c;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-101117: Improve accuracy of sqlite3.Cursor.rowcount docs (#104287) (#104381) The SQLite C API sqlite3_changes() can only be relied upon when the current active statement has been run to completion. --- diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 4dbbfe21ff66..249d29ce8993 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -1516,7 +1516,10 @@ Cursor objects ``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` for other statements, including :abbr:`CTE (Common Table Expression)` queries. - It is only updated by the :meth:`execute` and :meth:`executemany` methods. + It is only updated by the :meth:`execute` and :meth:`executemany` methods, + after the statement has run to completion. + This means that any resulting rows must be fetched in order for + :attr:`!rowcount` to be updated. .. attribute:: row_factory