Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
Ian Kelly authored March 13, 2009
3  django/core/cache/backends/db.py
@@ -35,7 +35,8 @@ def get(self, key, default=None):
35 35
             cursor.execute("DELETE FROM %s WHERE cache_key = %%s" % self._table, [key])
36 36
             transaction.commit_unless_managed()
37 37
             return default
38  
-        return pickle.loads(base64.decodestring(row[1]))
  38
+        value = connection.ops.process_clob(row[1])
  39
+        return pickle.loads(base64.decodestring(value))
39 40
 
40 41
     def set(self, key, value, timeout=None):
41 42
         self._base_set('set', key, value, timeout)
7  django/db/backends/__init__.py
@@ -212,6 +212,13 @@ def pk_default_value(self):
212 212
         """
213 213
         return 'DEFAULT'
214 214
 
  215
+    def process_clob(self, value):
  216
+        """
  217
+        Returns the value of a CLOB column, for backends that return a locator
  218
+        object that requires additional processing.
  219
+        """
  220
+        return value
  221
+
215 222
     def query_class(self, DefaultQueryClass):
216 223
         """
217 224
         Given the default Query class, returns a custom Query class
5  django/db/backends/oracle/base.py
@@ -115,6 +115,11 @@ def max_name_length(self):
115 115
     def prep_for_iexact_query(self, x):
116 116
         return x
117 117
 
  118
+    def process_clob(self, value):
  119
+        if value is None:
  120
+            return u''
  121
+        return force_unicode(value.read())
  122
+
118 123
     def query_class(self, DefaultQueryClass):
119 124
         return query.query_class(DefaultQueryClass, Database)
120 125
 

0 notes on commit 0eac35c

Please sign in to comment.
Something went wrong with that request. Please try again.