]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40956: Fix sqlite3.Cursor.fetchmany() default value (GH-24214)
authorErlend Egeberg Aasland <erlend.aasland@innova.no>
Wed, 13 Jan 2021 23:17:33 +0000 (00:17 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Jan 2021 23:17:33 +0000 (01:17 +0200)
Modules/_sqlite/clinic/cursor.c.h
Modules/_sqlite/cursor.c

index d5cf0a5eaadae173aee75c89c47ef394b67cd385..7a79d74818a2e2feedd1b85e6474da618b93929a 100644 (file)
@@ -138,10 +138,13 @@ pysqlite_cursor_fetchone(pysqlite_Cursor *self, PyObject *Py_UNUSED(ignored))
 }
 
 PyDoc_STRVAR(pysqlite_cursor_fetchmany__doc__,
-"fetchmany($self, /, size=cursor.arraysize)\n"
+"fetchmany($self, /, size=1)\n"
 "--\n"
 "\n"
-"Fetches several rows from the resultset.");
+"Fetches several rows from the resultset.\n"
+"\n"
+"  size\n"
+"    The default value is set by the Cursor.arraysize attribute.");
 
 #define PYSQLITE_CURSOR_FETCHMANY_METHODDEF    \
     {"fetchmany", (PyCFunction)(void(*)(void))pysqlite_cursor_fetchmany, METH_FASTCALL|METH_KEYWORDS, pysqlite_cursor_fetchmany__doc__},
@@ -256,4 +259,4 @@ pysqlite_cursor_close(pysqlite_Cursor *self, PyObject *Py_UNUSED(ignored))
 {
     return pysqlite_cursor_close_impl(self);
 }
-/*[clinic end generated code: output=11db0de4fb1951a9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6a2d4d49784aa686 input=a9049054013a1b77]*/
index 296d569148f8ae4b21d2c874cda052221955647e..0852aa940264a2efab6503b52e1ff7fd0694967c 100644 (file)
@@ -822,14 +822,15 @@ pysqlite_cursor_fetchone_impl(pysqlite_Cursor *self)
 /*[clinic input]
 _sqlite3.Cursor.fetchmany as pysqlite_cursor_fetchmany
 
-    size as maxrows: int(c_default='self->arraysize') = cursor.arraysize
+    size as maxrows: int(c_default='self->arraysize') = 1
+        The default value is set by the Cursor.arraysize attribute.
 
 Fetches several rows from the resultset.
 [clinic start generated code]*/
 
 static PyObject *
 pysqlite_cursor_fetchmany_impl(pysqlite_Cursor *self, int maxrows)
-/*[clinic end generated code: output=a8ef31fea64d0906 input=d80ff999a7701ffb]*/
+/*[clinic end generated code: output=a8ef31fea64d0906 input=c26e6ca3f34debd0]*/
 {
     PyObject* row;
     PyObject* list;