Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.0.X] Fixed #10488: fixed DB cache backend test failures in Oracle.…

… Backport of [10051] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10052 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0eac35ce119f108d2ffaeea745101cc3c4a85b98 1 parent 0ced9f6
@ikelly ikelly authored
View
3  django/core/cache/backends/db.py
@@ -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)
View
7 django/db/backends/__init__.py
@@ -212,6 +212,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 query_class(self, DefaultQueryClass):
"""
Given the default Query class, returns a custom Query class
View
5 django/db/backends/oracle/base.py
@@ -115,6 +115,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.