Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#23761 closed Bug (fixed)

Mysql validator crashes with None db_type return. - Backport of master fix to 1.7

Reported by: Adam DePue Owned by: Tim Graham
Component: Core (System checks) Version: 1.7
Severity: Release blocker Keywords: mysql db_type
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Adam DePue)

When implementing a custom field type with a db_type() method that returns None, on Django 1.6 and below we would signify not to create a column at all.
With Django 1.7, this causes a crash with the mysql backend.
The issue is already fixed in master and this simply backports the safety check.

A fix was made in August in master:
https://github.com/django/django/commit/e9103402c0fa873aea58a6a11dba510cd308cb84#diff-14

The fix contains a lot more than is needed for this specific issue, however the specific changes to django/db/backends/mysql/validation.py would be great to have in Django 1.7.

This worked fine in < Django 1.7 and works fine in upstream.

Change History (9)

comment:1 by Adam DePue, 10 years ago

Last edited 10 years ago by Adam DePue (previous) (diff)

comment:2 by Adam DePue, 10 years ago

Component: UncategorizedCore (System checks)
Easy pickings: set

comment:3 by Adam DePue, 10 years ago

Description: modified (diff)

comment:4 by Adam DePue, 10 years ago

Description: modified (diff)

comment:5 by Tim Graham, 10 years ago

Easy pickings: unset
Needs tests: set
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

A regression test and a mention in the 1.7.2 release notes is also required.

comment:6 by Adam DePue, 10 years ago

PR is updated to include mention in release notes as well as a regression test.
Updated PR here:
https://github.com/django/django/pull/3472

comment:7 by Tim Graham, 10 years ago

Needs tests: unset
Owner: changed from nobody to Tim Graham
Status: newassigned

comment:8 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 2d12a599383efff4ac1914e4cc5cf3b08cb2ff53:

[1.7.x] Fixed #23761 -- Fixed crash with MySQL validator and db_type is None.

The issue was fixed on master in e9103402c0fa873aea58a6a11dba510cd308cb84.

comment:9 by Tim Graham <timograham@…>, 10 years ago

In e118e3af371ae58cee7420d2ea2020c8bdeb461e:

Fixed #23761 -- Added test for MySQL validator and db_type is None.

The issue was fixed on master in e9103402c0fa873aea58a6a11dba510cd308cb84
so this just forwardports the test and release notes from stable/1.7.x.

Forwardport of 2d12a59938 from stable/1.7.x

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