]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Oracle default arraysize is now set by the driver
authorFederico Caselli <cfederico87@gmail.com>
Fri, 12 Jan 2024 18:17:30 +0000 (19:17 +0100)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 17 Jan 2024 21:50:52 +0000 (16:50 -0500)
Changed the default arraysize of the Oracle dialects so that the value set
by the driver is used, that is 100 at the time of writing for both
cx_oracle and oracledb. Previously the value was set to 50 by default.

Fixes: #10877
Change-Id: Ie4c53f42437d3d7dbbad36398d7883472577f367
(cherry picked from commit c8214ad4389284dc9508e49aeca701e5bf164454)

doc/build/changelog/unreleased_20/10877.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/dialects/oracle/oracledb.py
test/requirements.py

diff --git a/doc/build/changelog/unreleased_20/10877.rst b/doc/build/changelog/unreleased_20/10877.rst
new file mode 100644 (file)
index 0000000..8aaac98
--- /dev/null
@@ -0,0 +1,7 @@
+.. change::
+    :tags: oracle
+    :tickets: 10877
+
+    Changed the default arraysize of the Oracle dialects so that the value set
+    by the driver is used, that is 100 at the time of writing for both
+    cx_oracle and oracledb. Previously the value was set to 50 by default.
index e8ed3ab5cb2c23da340d60fac1a1c8d7d087ea3d..69ee82bd2345027506a5e13f72ceb1569d1a4fe8 100644 (file)
@@ -126,10 +126,15 @@ itself.  These options are always passed directly to :func:`_sa.create_engine`
 
 The parameters accepted by the cx_oracle dialect are as follows:
 
-* ``arraysize`` - set the cx_oracle.arraysize value on cursors, defaulted
-  to 50.  This setting is significant with cx_Oracle as the contents of LOB
-  objects are only readable within a "live" row (e.g. within a batch of
-  50 rows).
+* ``arraysize`` - set the cx_oracle.arraysize value on cursors; defaults
+  to ``None``, indicating that the driver default should be used (typically
+  the value is 100).  This setting controls how many rows are buffered when
+  fetching rows, and can have a significant effect on performance when
+  modified.   The setting is used for both ``cx_Oracle`` as well as
+  ``oracledb``.
+
+  .. versionchanged:: 2.0.26 - changed the default value from 50 to None,
+    to use the default value of the driver itself.
 
 * ``auto_convert_lobs`` - defaults to True; See :ref:`cx_oracle_lob`.
 
@@ -1033,7 +1038,7 @@ class OracleDialect_cx_oracle(OracleDialect):
         self,
         auto_convert_lobs=True,
         coerce_to_decimal=True,
-        arraysize=50,
+        arraysize=None,
         encoding_errors=None,
         threaded=None,
         **kwargs,
index 1229573ad1e8245ff54c04b510f56edd1beb4d88..9cdec3b55aef3a46a48a30599b462b6b985ba78f 100644 (file)
@@ -105,7 +105,7 @@ class OracleDialect_oracledb(_OracleDialect_cx_oracle):
         self,
         auto_convert_lobs=True,
         coerce_to_decimal=True,
-        arraysize=50,
+        arraysize=None,
         encoding_errors=None,
         thick_mode=None,
         **kwargs,
index 4a0b365c2b546bd5bf5d699a3ef9de278dd092a7..a5a389441dd12273861c60e929bdec306a82d332 100644 (file)
@@ -784,7 +784,7 @@ class DefaultRequirements(SuiteRequirements):
         #8221.
 
         """
-        return fails_if(["mssql", "oracle>=12"])
+        return fails_if(["mssql", "oracle < 23"])
 
     @property
     def parens_in_union_contained_select_w_limit_offset(self):