1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #11487: pass long strings to Oracle as CLOB rather than NCLOB to prevent an encoding bug that occurs in some installations.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11285 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ian Kelly
2009-07-21 21:20:18 +00:00
parent 2d781aae5f
commit bbac0cc965
2 changed files with 18 additions and 3 deletions

View File

@@ -17,6 +17,21 @@ class Callproc(unittest.TestCase):
return True
else:
return True
class LongString(unittest.TestCase):
def test_long_string(self):
# If the backend is Oracle, test that we can save a text longer
# than 4000 chars and read it properly
if settings.DATABASE_ENGINE == 'oracle':
c = connection.cursor()
c.execute('CREATE TABLE ltext ("TEXT" NCLOB)')
long_str = ''.join([unicode(x) for x in xrange(4000)])
c.execute('INSERT INTO ltext VALUES (%s)',[long_str])
c.execute('SELECT text FROM ltext')
row = c.fetchone()
c.execute('DROP TABLE ltext')
self.assertEquals(long_str, row[0].read())
def connection_created_test(sender, **kwargs):
print 'connection_created signal'