Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#489 closed defect (fixed)

[patch] MySQL: TextField => longtext

Reported by: eugene@… Owned by: adrian
Component: Database layer (models, ORM) Version:
Severity: trivial Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Django maps 'TextField' to MySQL's 'text', which cannot be longer than 64k. I already hit this limit with SQL-based cache. I think that 'longtext' is the better mapping choice. It can be as long as 4G. IMHO, 2 byte size difference is justified in this case.

Index: mysql.py
===================================================================
--- mysql.py	(revision 635)
+++ mysql.py	(working copy)
@@ -129,7 +178,7 @@
     'PositiveSmallIntegerField': 'smallint UNSIGNED',
     'SlugField':         'varchar(50)',
     'SmallIntegerField': 'smallint',
-    'TextField':         'text',
+    'TextField':         'longtext',
     'TimeField':         'time',
     'URLField':          'varchar(200)',
     'USStateField':      'varchar(2)',

Attachments (1)

mysql-2.patch (487 bytes) - added by anonymous 10 years ago.
patch in the file

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by anonymous

patch in the file

comment:1 Changed 10 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [680].

comment:2 Changed 10 years ago by eugene@…

  • Resolution fixed deleted
  • Severity changed from normal to trivial
  • Status changed from closed to reopened

Sorry I missed it before: 'XMLField' in mysql.py should be 'longtext' too.

comment:3 Changed 10 years ago by adrian

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [694]) Fixed #489 -- Changed MySQL backend to use longtext for XMLField

Note: See TracTickets for help on using tickets.
Back to Top