[Django] #27676: MariaDB 10.2 supports defaults for text columns

18 views
Skip to first unread message

Django

unread,
Jan 2, 2017, 1:32:27 PM1/2/17
to django-...@googlegroups.com
#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
Reporter: Adam | Owner: Adam Chainz
Chainz |
Type: Bug | Status: assigned
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Django has workaround code for MySQL's deficiency not supporting DEFAULT
for TEXT, BLOB, and JSON columns, but MariaDB 10.2 fixes this ( see
https://mariadb.com/kb/en/mariadb/what-is-mariadb-102/: "BLOB and TEXT
fields can now have a DEFAULT value." ).

Django should allow DEFAULT for these columns when on MariaDB 10.2+.

--
Ticket URL: <https://code.djangoproject.com/ticket/27676>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 2, 2017, 3:10:55 PM1/2/17
to django-...@googlegroups.com
#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
Reporter: Adam Chainz | Owner: Adam
| Chainz
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* type: Bug => New feature
* stage: Unreviewed => Someday/Maybe


Comment:

First some consensus is needed about whether Django
[https://groups.google.com/d/topic/django-
developers/31j1dNOZ7zc/discussion should officially support MariaDB].

--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:1>

Django

unread,
Jan 2, 2017, 5:48:11 PM1/2/17
to django-...@googlegroups.com
#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
Reporter: Adam Chainz | Owner: Adam
| Chainz
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Adam Chainz):

Thanks, I missed that thread, commented

--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:2>

Django

unread,
Jan 9, 2017, 7:14:39 PM1/9/17
to django-...@googlegroups.com
#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
Reporter: Adam Chainz | Owner: Adam
| Chainz
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1
* stage: Someday/Maybe => Ready for checkin


Comment:

[https://github.com/django/django/pull/7778 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:3>

Django

unread,
May 10, 2017, 8:04:08 AM5/10/17
to django-...@googlegroups.com
#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Adam
Johnson | (Chainz) Johnson

Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted


Comment:

On the PR, Adam said, "I was thinking of forming a better plan around
MariaDB first."

--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:4>

Django

unread,
Jul 19, 2019, 10:39:44 AM7/19/19
to django-...@googlegroups.com
#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Adam
Johnson | (Chainz) Johnson
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by felixxm):

Django 3.0 will officially support MariaDB 10.1+. I think it's time to
change this feature flag. Adam, can you resubmit your patch?

--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:5>

Django

unread,
Aug 15, 2019, 10:20:18 AM8/15/19
to django-...@googlegroups.com
#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Adam
Johnson | (Chainz) Johnson
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam (Chainz) Johnson):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:6>

Django

unread,
Aug 16, 2019, 6:05:21 AM8/16/19
to django-...@googlegroups.com
#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Adam
Johnson | (Chainz) Johnson
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"7da6a28a447dc0db2a2c6ef31894094eb968f408" 7da6a28a]:
{{{
#!CommitTicketReference repository=""
revision="7da6a28a447dc0db2a2c6ef31894094eb968f408"
Fixed #27676 -- Allowed BLOB/TEXT defaults on MariaDB 10.2.1+.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:7>

Django

unread,
Nov 28, 2023, 5:57:46 AM11/28/23
to django-...@googlegroups.com
#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam

| Johnson
Type: New feature | Status: closed
Component: Database layer | Version: dev

(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tobias Krönke):

Could we skip the default if it's the empty string for MySQL? Explicitly
setting the empty string prevents the `ALGORITHM=INSTANT` magic from
adding the column without table copying. This would be a huge performance
improvement for many users. I have seen so many issues where people would
like to add new columns to very large tables efficiently. MySQL has this
now built-in, but django prevents it by redudantly specifying the empty
string as default. This is enough and makes the instant algorithm work:

{{{
ALTER TABLE `<table name>` ADD COLUMN `<column name>` longtext NOT NULL;
}}}


Same for CHAR and VARCHAR.

--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:8>

Django

unread,
Nov 28, 2023, 9:13:15 AM11/28/23
to django-...@googlegroups.com
#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: New feature | Status: new

Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tobias Krönke):

* status: closed => new
* resolution: fixed =>


Comment:

PR added: https://github.com/django/django/pull/17539

--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:9>

Django

unread,
Nov 28, 2023, 9:33:44 AM11/28/23
to django-...@googlegroups.com
#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: New feature | Status: closed

Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => fixed


Comment:

Please open a new ticket rather than reopening an old one.

--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:10>

Reply all
Reply to author
Forward
0 new messages