Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 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
@@ -255,6 +255,13 @@ def pk_default_value(self):
255 255
         """
256 256
         return 'DEFAULT'
257 257
 
  258
+    def process_clob(self, value):
  259
+        """
  260
+        Returns the value of a CLOB column, for backends that return a locator
  261
+        object that requires additional processing.
  262
+        """
  263
+        return value
  264
+
258 265
     def return_insert_id(self):
259 266
         """
260 267
         For backends that support returning the last insert ID as part
5  django/db/backends/oracle/base.py
@@ -123,6 +123,11 @@ def max_name_length(self):
123 123
     def prep_for_iexact_query(self, x):
124 124
         return x
125 125
 
  126
+    def process_clob(self, value):
  127
+        if value is None:
  128
+            return u''
  129
+        return force_unicode(value.read())
  130
+
126 131
     def query_class(self, DefaultQueryClass):
127 132
         return query.query_class(DefaultQueryClass, Database)
128 133
 

0 notes on commit 83c1572

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