Fixed #23145 -- Dropped support for Oracle < 11.1

This commit is contained in:
Tim Graham 2014-08-01 12:53:18 -04:00
parent a2479f46f3
commit 8f9d6e83a0
4 changed files with 13 additions and 29 deletions

View File

@ -359,22 +359,13 @@ WHEN (new.%(col_name)s IS NULL)
def random_function_sql(self): def random_function_sql(self):
return "DBMS_RANDOM.RANDOM" return "DBMS_RANDOM.RANDOM"
def regex_lookup_9(self, lookup_type): def regex_lookup(self, lookup_type):
raise NotImplementedError("Regexes are not supported in Oracle before version 10g.")
def regex_lookup_10(self, lookup_type):
if lookup_type == 'regex': if lookup_type == 'regex':
match_option = "'c'" match_option = "'c'"
else: else:
match_option = "'i'" match_option = "'i'"
return 'REGEXP_LIKE(%%s, %%s, %s)' % match_option return 'REGEXP_LIKE(%%s, %%s, %s)' % match_option
def regex_lookup(self, lookup_type):
# If regex_lookup is called before it's been initialized, then create
# a cursor to initialize it and recur.
with self.connection.cursor():
return self.connection.ops.regex_lookup(lookup_type)
def return_insert_id(self): def return_insert_id(self):
return "RETURNING %s INTO %%s", (InsertIdVar(),) return "RETURNING %s INTO %%s", (InsertIdVar(),)
@ -646,15 +637,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
self.operators = self._standard_operators self.operators = self._standard_operators
cursor.close() cursor.close()
# There's no way for the DatabaseOperations class to know the
# currently active Oracle version, so we do some setups here.
# TODO: Multi-db support will need a better solution (a way to
# communicate the current version).
if self.oracle_version is not None and self.oracle_version <= 9:
self.ops.regex_lookup = self.ops.regex_lookup_9
else:
self.ops.regex_lookup = self.ops.regex_lookup_10
try: try:
self.connection.stmtcachesize = 20 self.connection.stmtcachesize = 20
except AttributeError: except AttributeError:
@ -713,11 +695,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
def is_usable(self): def is_usable(self):
try: try:
if hasattr(self.connection, 'ping'): # Oracle 10g R2 and higher
self.connection.ping() self.connection.ping()
else:
# Use a cx_Oracle cursor directly, bypassing Django's utilities.
self.connection.cursor().execute("SELECT 1 FROM DUAL")
except Database.Error: except Database.Error:
return False return False
else: else:

View File

@ -63,7 +63,7 @@ Database Library Requirements Supported Versions Notes
================== ============================== ================== ========================================= ================== ============================== ================== =========================================
PostgreSQL GEOS, PROJ.4, PostGIS 9.0+ Requires PostGIS. PostgreSQL GEOS, PROJ.4, PostGIS 9.0+ Requires PostGIS.
MySQL GEOS 5.x Not OGC-compliant; :ref:`limited functionality <mysql-spatial-limitations>`. MySQL GEOS 5.x Not OGC-compliant; :ref:`limited functionality <mysql-spatial-limitations>`.
Oracle GEOS 10.2, 11 XE not supported; not tested with 9. Oracle GEOS 11.1+ XE not supported.
SQLite GEOS, GDAL, PROJ.4, SpatiaLite 3.6.+ Requires SpatiaLite 2.3+, pysqlite2 2.5+ SQLite GEOS, GDAL, PROJ.4, SpatiaLite 3.6.+ Requires SpatiaLite 2.3+, pysqlite2 2.5+
================== ============================== ================== ========================================= ================== ============================== ================== =========================================

View File

@ -695,10 +695,9 @@ you add quotes where necessary before copying a query into an SQLite shell.
Oracle notes Oracle notes
============ ============
Django supports `Oracle Database Server`_ versions 9i and Django supports `Oracle Database Server`_ versions 11.1 and higher. Version
higher. Oracle version 10g or later is required to use Django's 4.3.1 or higher of the `cx_Oracle`_ Python driver is required, although we
``regex`` and ``iregex`` query operators. You will also need at least recommend version 5.1.3 or later as these versions support Python 3.
version 4.3.1 of the `cx_Oracle`_ Python driver.
Note that due to a Unicode-corruption bug in ``cx_Oracle`` 5.0, that Note that due to a Unicode-corruption bug in ``cx_Oracle`` 5.0, that
version of the driver should **not** be used with Django; version of the driver should **not** be used with Django;

View File

@ -407,6 +407,13 @@ officially supports.
This also includes dropping support for PostGIS 1.3 and 1.4 as these versions This also includes dropping support for PostGIS 1.3 and 1.4 as these versions
are not supported on versions of PostgreSQL later than 8.4. are not supported on versions of PostgreSQL later than 8.4.
Support for Oracle versions older than 11.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The end of upstream support periods was reached in July 2010 for Oracle 9.2,
January 2012 for Oracle 10.1, and July 2013 for Oracle 10.2. As a consequence,
Django 1.8 sets 11.1 as the minimum Oracle version it officially supports.
``AbstractUser.last_login`` allows null values ``AbstractUser.last_login`` allows null values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~