From d696fccae6ea0868855aa28f8d2bc2f7f77ac208 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Tue, 13 Mar 2018 06:57:14 +0500 Subject: Fixed #29209 -- Fixed Cast() with TextField on MySQL and Oracle. --- django/db/backends/mysql/operations.py | 1 + django/db/backends/oracle/operations.py | 3 +++ 2 files changed, 4 insertions(+) (limited to 'django') diff --git a/django/db/backends/mysql/operations.py b/django/db/backends/mysql/operations.py index 88e47b95ba..2b85be9c56 100644 --- a/django/db/backends/mysql/operations.py +++ b/django/db/backends/mysql/operations.py @@ -18,6 +18,7 @@ class DatabaseOperations(BaseDatabaseOperations): } cast_data_types = { 'CharField': 'char(%(max_length)s)', + 'TextField': 'char', 'IntegerField': 'signed integer', 'BigIntegerField': 'signed integer', 'SmallIntegerField': 'signed integer', diff --git a/django/db/backends/oracle/operations.py b/django/db/backends/oracle/operations.py index 748f606368..d11072bd2c 100644 --- a/django/db/backends/oracle/operations.py +++ b/django/db/backends/oracle/operations.py @@ -51,6 +51,9 @@ END; # Oracle doesn't support string without precision; use the max string size. cast_char_field_without_max_length = 'NVARCHAR2(2000)' + cast_data_types = { + 'TextField': cast_char_field_without_max_length, + } def cache_key_culling_sql(self): return """ -- cgit v1.3