Issue 49 in django-evolution: In SQLite, adding null fields populates the field value with the field name

1 view
Skip to first unread message

codesite...@google.com

unread,
Nov 15, 2008, 10:55:44 AM11/15/08
to django-evolu...@googlegroups.com
Issue 49: In SQLite, adding null fields populates the field value with the
field name
http://code.google.com/p/django-evolution/issues/detail?id=49

Comment #3 by m.t.pekkarinen:
The patch in comment 1 fixes the bug for null fields, but adding a field
with
null=True no longer works: I get an error

Error applying evolution: TEMP_TABLE.<fieldname> may not be NULL

The attached new patch fixes this for me: when a null field is added and no
initial
value is given, do as chipx explains in comment 1. Otherwise, do what the
code
already does in r164.

The minimal changes fix the problem, but the code is far too clever to my
taste.
The trick "make 2 references to a list so that appending to one of them
modifies
both and then SELECT with non-existent column name, which populates the
TEMP_TABLE
column with the column's name and then overwrite that with the initial
value" seems
more like an accident than a propely thought out way to get the correct
result.


Attachments:
sqlite3_add_field_fix2.diff 1.1 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
May 28, 2009, 7:19:22 PM5/28/09
to django-evolu...@googlegroups.com

Comment #4 on issue 49 by smileychris: In SQLite, adding null fields
populates the field value with the field name
http://code.google.com/p/django-evolution/issues/detail?id=49

Here's the correct fix for null fields, plus the original fix (plus a
modification
because the original caused a new bug with renaming fields), and all tests
updated.

Attachments:
sqlite_add_field_easy_fix.diff 84.2 KB

Reply all
Reply to author
Forward
0 new messages