[Django] #25128: SQLite SchemaEditor crashes when adding a ForeignObject field

10 views
Skip to first unread message

Django

unread,
Jul 15, 2015, 2:38:05 PM7/15/15
to django-...@googlegroups.com
#25128: SQLite SchemaEditor crashes when adding a ForeignObject field
--------------------------------------+---------------------------
Reporter: timgraham | Owner: timgraham
Type: Bug | Status: new
Component: Migrations | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+---------------------------
Adding a `ForeignObject` field to an existing model will fail like this on
SQLite:
{{{
======================================================================
ERROR: test_add_foreign_object (schema.tests.SchemaTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tim/code/django/tests/schema/tests.py", line 1518, in
test_add_foreign_object
editor.add_field(BookForeignObj, new_field)
File "/home/tim/code/django/django/db/backends/sqlite3/schema.py", line
221, in add_field
self._remake_table(model, create_fields=[field])
File "/home/tim/code/django/django/db/backends/sqlite3/schema.py", line
187, in _remake_table
', '.join(self.quote_name(x) for x, y in field_maps),
File "/home/tim/code/django/django/db/backends/sqlite3/schema.py", line
187, in <genexpr>
', '.join(self.quote_name(x) for x, y in field_maps),
File "/home/tim/code/django/django/db/backends/base/schema.py", line
113, in quote_name
return self.connection.ops.quote_name(name)
File "/home/tim/code/django/django/db/backends/sqlite3/operations.py",
line 107, in quote_name
if name.startswith('"') and name.endswith('"'):
AttributeError: 'NoneType' object has no attribute 'startswith'
}}}

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

Django

unread,
Jul 15, 2015, 2:40:49 PM7/15/15
to django-...@googlegroups.com
#25128: SQLite SchemaEditor crashes when adding a ForeignObject field
----------------------------+-------------------------------------

Reporter: timgraham | Owner: timgraham
Type: Bug | Status: new
Component: Migrations | Version: 1.8
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 timgraham):

* has_patch: 0 => 1


Comment:

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

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

Django

unread,
Jul 15, 2015, 3:29:15 PM7/15/15
to django-...@googlegroups.com
#25128: SQLite SchemaEditor crashes when adding a ForeignObject field
----------------------------+-------------------------------------
Reporter: timgraham | Owner: timgraham
Type: Bug | Status: closed
Component: Migrations | Version: 1.8
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 <timograham@…>):

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


Comment:

In [changeset:"c52822e7501e8478abf99465d8c9f3102dde618a" c52822e]:
{{{
#!CommitTicketReference repository=""
revision="c52822e7501e8478abf99465d8c9f3102dde618a"
Fixed #25128 -- Fixed SQLite SchemaEditor crash when adding a
ForeignObject field.
}}}

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

Reply all
Reply to author
Forward
0 new messages