Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #10488: fixed DB cache backend test failures in Oracle.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10051 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 83c1572cc47283b97c78a4b695788bcb755ca358 1 parent 0ae95f8
Ian Kelly ikelly authored
3  django/core/cache/backends/db.py
View
@@ -35,7 +35,8 @@ def get(self, key, default=None):
cursor.execute("DELETE FROM %s WHERE cache_key = %%s" % self._table, [key])
transaction.commit_unless_managed()
return default
- return pickle.loads(base64.decodestring(row[1]))
+ value = connection.ops.process_clob(row[1])
+ return pickle.loads(base64.decodestring(value))
def set(self, key, value, timeout=None):
self._base_set('set', key, value, timeout)
7 django/db/backends/__init__.py
View
@@ -255,6 +255,13 @@ def pk_default_value(self):
"""
return 'DEFAULT'
+ def process_clob(self, value):
+ """
+ Returns the value of a CLOB column, for backends that return a locator
+ object that requires additional processing.
+ """
+ return value
+
def return_insert_id(self):
"""
For backends that support returning the last insert ID as part
5 django/db/backends/oracle/base.py
View
@@ -123,6 +123,11 @@ def max_name_length(self):
def prep_for_iexact_query(self, x):
return x
+ def process_clob(self, value):
+ if value is None:
+ return u''
+ return force_unicode(value.read())
+
def query_class(self, DefaultQueryClass):
return query.query_class(DefaultQueryClass, Database)
Please sign in to comment.
Something went wrong with that request. Please try again.