From 2d781aae5f3dad007c710eb9f6c6cc20a0fc0dac Mon Sep 17 00:00:00 2001 From: Gary Wilson Jr Date: Tue, 21 Jul 2009 16:45:13 +0000 Subject: [PATCH 1/2] Updated my bio. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11281 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/internals/committers.txt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/internals/committers.txt b/docs/internals/committers.txt index 9f77e98c07..69736ce880 100644 --- a/docs/internals/committers.txt +++ b/docs/internals/committers.txt @@ -149,10 +149,20 @@ Joseph Kocherhans .. _brian rosner: http://oebfare.com/ .. _this week in django: http://thisweekindjango.com/ -Gary Wilson - In early 2007, Gary started contributing a lot of cleanup fixes and fixing - broken windows. He's continued to do that necessary tidying up work - throughout the code base since then. +`Gary Wilson`_ + Gary starting contributing patches to Django in 2006 while developing Web + applications for `The University of Texas`_ (UT). Since, he has made + contributions to the e-mail and forms systems, as well as many other + improvements and code cleanups throughout the code base. + + Gary is currently a developer and software engineering graduate student at + UT, where his dedication to spreading the ways of Python and Django never + ceases. + + Gary lives in Austin, Texas, USA. + +.. _Gary Wilson: http://gdub.wordpress.com/ +.. _The University of Texas: http://www.utexas.edu/ Justin Bronn Justin Bronn is a computer scientist and attorney specializing From bbac0cc965ea90f31a365891d4e21b1bffa58f4a Mon Sep 17 00:00:00 2001 From: Ian Kelly Date: Tue, 21 Jul 2009 21:20:18 +0000 Subject: [PATCH 2/2] 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 --- django/db/backends/oracle/base.py | 6 +++--- tests/regressiontests/backends/tests.py | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index 7d85979294..80558a0a68 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -345,7 +345,7 @@ class OracleParam(object): """ Wrapper object for formatting parameters for Oracle. If the string representation of the value is large enough (greater than 4000 characters) - the input size needs to be set as NCLOB. Alternatively, if the parameter + the input size needs to be set as CLOB. Alternatively, if the parameter has an `input_size` attribute, then the value of the `input_size` attribute will be used instead. Otherwise, no input size will be set for the parameter when executing the query. @@ -360,8 +360,8 @@ class OracleParam(object): # If parameter has `input_size` attribute, use that. self.input_size = param.input_size elif isinstance(param, basestring) and len(param) > 4000: - # Mark any string param greater than 4000 characters as an NCLOB. - self.input_size = Database.NCLOB + # Mark any string param greater than 4000 characters as a CLOB. + self.input_size = Database.CLOB else: self.input_size = None diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py index 81dcfde30d..aff27369ad 100644 --- a/tests/regressiontests/backends/tests.py +++ b/tests/regressiontests/backends/tests.py @@ -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'