From: Federico Caselli Date: Fri, 12 Jan 2024 18:17:30 +0000 (+0100) Subject: Oracle default arraysize is now set by the driver X-Git-Tag: rel_2_0_26~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deb71a9b4079dea57ce81875cbf34425c7f8e731;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Oracle default arraysize is now set by the driver 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) --- diff --git a/doc/build/changelog/unreleased_20/10877.rst b/doc/build/changelog/unreleased_20/10877.rst new file mode 100644 index 0000000000..8aaac983b4 --- /dev/null +++ b/doc/build/changelog/unreleased_20/10877.rst @@ -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. diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py index e8ed3ab5cb..69ee82bd23 100644 --- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py +++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py @@ -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, diff --git a/lib/sqlalchemy/dialects/oracle/oracledb.py b/lib/sqlalchemy/dialects/oracle/oracledb.py index 1229573ad1..9cdec3b55a 100644 --- a/lib/sqlalchemy/dialects/oracle/oracledb.py +++ b/lib/sqlalchemy/dialects/oracle/oracledb.py @@ -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, diff --git a/test/requirements.py b/test/requirements.py index 4a0b365c2b..a5a389441d 100644 --- a/test/requirements.py +++ b/test/requirements.py @@ -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):