]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
amend cx_Oracle version checks, setup.cfg to oracle 8
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 13 Oct 2023 18:01:07 +0000 (14:01 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 13 Oct 2023 18:13:13 +0000 (14:13 -0400)
Fixed issue where the cx_Oracle dialect claimed to support a lower
cx_Oracle version (7.x) than was actually supported in practice within the
2.0 series of SQLAlchemy. The dialect imports symbols that are only in
cx_Oracle 8 or higher, so runtime dialect checks as well as setup.cfg
requirements have been updated to reflect this compatibility.

Fixes: #10470
Change-Id: Ic955c085e2239a632031d5a80a8b9a9c697a88f8

doc/build/changelog/unreleased_20/10470.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/oracle/cx_oracle.py
setup.cfg
test/dialect/oracle/test_dialect.py

diff --git a/doc/build/changelog/unreleased_20/10470.rst b/doc/build/changelog/unreleased_20/10470.rst
new file mode 100644 (file)
index 0000000..9584750
--- /dev/null
@@ -0,0 +1,9 @@
+.. change::
+    :tags: bug, oracle
+    :tickets: 10470
+
+    Fixed issue where the cx_Oracle dialect claimed to support a lower
+    cx_Oracle version (7.x) than was actually supported in practice within the
+    2.0 series of SQLAlchemy. The dialect imports symbols that are only in
+    cx_Oracle 8 or higher, so runtime dialect checks as well as setup.cfg
+    requirements have been updated to reflect this compatibility.
index a73d1699de5b4b068239feedc72603e467c5441d..c595b56c5620ecd10d1c8879370a0b199b51ff78 100644 (file)
@@ -1088,9 +1088,9 @@ class OracleDialect_cx_oracle(OracleDialect):
                     int(x) for x in m.group(1, 2, 3) if x is not None
                 )
         self.cx_oracle_ver = version
-        if self.cx_oracle_ver < (7,) and self.cx_oracle_ver > (0, 0, 0):
+        if self.cx_oracle_ver < (8,) and self.cx_oracle_ver > (0, 0, 0):
             raise exc.InvalidRequestError(
-                "cx_Oracle version 7 and above are supported"
+                "cx_Oracle version 8 and above are supported"
             )
 
     @classmethod
index 6bd9cf59bc90d91bb823025d891ff7156b806f06..2c810d753647e8c01f9028429584749010a9f8b3 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -55,7 +55,7 @@ mysql_connector =
 mariadb_connector =
     mariadb>=1.0.1,!=1.1.2,!=1.1.5
 oracle =
-    cx_oracle>=7
+    cx_oracle>=8
 oracle_oracledb =
     oracledb>=1.0.1
 postgresql = psycopg2>=2.7
index ae4f6fe9d4a838c203d3e81ee3e503621c1a019a..93cf0b74578aaf94147048310eb4344d4889473e 100644 (file)
@@ -51,21 +51,21 @@ class CxOracleDialectTest(fixtures.TestBase):
             dialect._load_version(dbapi)
             return dialect.cx_oracle_ver
 
-        eq_(check("7.2"), (7, 2))
-        eq_(check("7.0.1"), (7, 0, 1))
+        eq_(check("8.2"), (8, 2))
+        eq_(check("8.0.1"), (8, 0, 1))
         eq_(check("9.0b1"), (9, 0))
 
     def test_minimum_version(self):
         with expect_raises_message(
             exc.InvalidRequestError,
-            "cx_Oracle version 7 and above are supported",
+            "cx_Oracle version 8 and above are supported",
         ):
             cx_oracle.OracleDialect_cx_oracle(dbapi=Mock(version="5.1.5"))
 
         dialect = cx_oracle.OracleDialect_cx_oracle(
-            dbapi=Mock(version="7.1.0")
+            dbapi=Mock(version="8.1.0")
         )
-        eq_(dialect.cx_oracle_ver, (7, 1, 0))
+        eq_(dialect.cx_oracle_ver, (8, 1, 0))
 
 
 class OracleDbDialectTest(fixtures.TestBase):
@@ -323,7 +323,7 @@ class EncodingErrorsTest(fixtures.TestBase):
             FIXED_CHAR=self.cx_Oracle_FIXED_CHAR,
             CLOB=self.cx_Oracle_CLOB,
             NCLOB=self.cx_Oracle_NCLOB,
-            version="7.0.1",
+            version="8.0.1",
             __future__=mock.Mock(),
         )