--
Ticket URL: <https://code.djangoproject.com/ticket/17713>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: anssi.kaariainen@… (added)
* needs_docs: => 0
* needs_better_patch: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
This is a really minor issue, but also an easy one to fix.
If somebody with older MySQL versions could test this it would be valuable
information. I have tested this on 5.1 where id INTEGER PRIMARY KEY
accepts zero as a value. Based on that marking as accepted.
I think changing the name is the correct thing to do.
--
Ticket URL: <https://code.djangoproject.com/ticket/17713#comment:1>
Comment (by vajrasky):
PR: https://github.com/django/django/pull/1984
Later, in a separate ticket I will create a unit test for exercising the
MySQL capability of using non-autoincrement primary key with value 0.
--
Ticket URL: <https://code.djangoproject.com/ticket/17713#comment:2>
* has_patch: 0 => 1
Comment:
I guess the only concern here is whether or not setting this attribute on
your own database backend is considered private API subject to change?
--
Ticket URL: <https://code.djangoproject.com/ticket/17713#comment:3>
Comment (by vajrasky):
This is the separate ticket for adding unit test exercising the capability
of having zero non-autoincrement primary key, #21517.
--
Ticket URL: <https://code.djangoproject.com/ticket/17713#comment:4>
Comment (by vajrasky):
@timo: or we can add another attribute (allows_auto_pk_0) and keep this
one (allows_primary_key_0).
--
Ticket URL: <https://code.djangoproject.com/ticket/17713#comment:5>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"d3cf6cfacfb828faad4f4f97c904e259304649b3"]:
{{{
#!CommitTicketReference repository=""
revision="d3cf6cfacfb828faad4f4f97c904e259304649b3"
Fixed #17713 -- Renamed BaseDatabaseFeatures.allows_primary_key_0 to
allows_auto_pk_0.
MySQL does allow primary key with value 0. It only forbids autoincrement
primary key with value 0.
Thanks Claude Paroz for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/17713#comment:6>