#23761: Mysql validator crashes with None db_type return. - Backport of master 
fix
to 1.7
-------------------------------------+-------------------------------------
     Reporter:  adepue               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (System         |                  Version:  1.7
  checks)                            |               Resolution:
     Severity:  Normal               |             Triage Stage:
     Keywords:  mysql db_type        |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by adepue:

Old description:

> 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
>
> The issue is that if you create a custom field that returns None for
> db_type(), then it causes crashes due to dereference None to check the
> startswith().
>
> This worked fine in < Django 1.7 and works fine in upstream.

New description:

 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.

 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.

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

--

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.b6ff5aa2b79ea6c9bdaea20731f35b45%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to