Re: [Django] #35022: RenameIndex crashes when there is a unique index on the same fields.

42 views
Skip to first unread message

Django

unread,
Dec 7, 2023, 7:32:10 AM12/7/23
to django-...@googlegroups.com
#35022: RenameIndex crashes when there is a unique index on the same fields.
-----------------------------------+------------------------------------
Reporter: Thomas Capricelli | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by Thomas Capricelli):

I dont understand fully what's happening, but yes, it fixes it for me.
Congrats !

I tested with django 5.0 and the line in the file was slightly different.

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

Django

unread,
Dec 7, 2023, 11:39:08 AM12/7/23
to django-...@googlegroups.com
#35022: RenameIndex crashes when there is a unique index on the same fields.
-----------------------------------+------------------------------------
Reporter: Thomas Capricelli | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by Yash Kumar Verma):

is someone working on a merge request for this? if not, can I try
submitting this patch?

--
Ticket URL: <https://code.djangoproject.com/ticket/35022#comment:5>

Django

unread,
Dec 7, 2023, 12:12:28 PM12/7/23
to django-...@googlegroups.com
#35022: RenameIndex crashes when there is a unique index on the same fields.
-----------------------------------+------------------------------------
Reporter: Thomas Capricelli | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:5 Yash Kumar Verma]:


> is someone working on a merge request for this? if not, can I try
submitting this patch?

Yes you can, please remember that a regression test is required.

--
Ticket URL: <https://code.djangoproject.com/ticket/35022#comment:6>

Django

unread,
Dec 12, 2023, 11:26:16 AM12/12/23
to django-...@googlegroups.com
#35022: RenameIndex crashes when there is a unique index on the same fields.
-----------------------------------+------------------------------------
Reporter: Thomas Capricelli | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by Prakhar Parashari):

Replying to [comment:2 Thomas Capricelli]:
> I created a minimal exemple. All of this is done using django 4.2 (but
i'm pretty sure it does the same with django 5.0):
>
> How to use:
> ./manage.py makemigrations main && ./manage.py migrate # create initial
migrations
> vi main/models.py # comment index_together, uncomment indexes =
> ./manage.py makemigrations main && ./manage.py migrate # crash


Hey, I tried to reproduce this with your minimal example with Django 5.0
and Django 4.2. However, I couldn't reproduce it. Maybe the example file
is missing something that was producing this error for you? I'm not sure

--
Ticket URL: <https://code.djangoproject.com/ticket/35022#comment:7>

Django

unread,
Dec 21, 2023, 4:20:12 PM12/21/23
to django-...@googlegroups.com
#35022: RenameIndex crashes when there is a unique index on the same fields.
-------------------------------------+-------------------------------------
Reporter: Thomas Capricelli | Owner: David
| Wobrock
Type: Bug | Status: assigned

Component: Migrations | Version: 5.0
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 David Wobrock):

* owner: nobody => David Wobrock
* status: new => assigned
* has_patch: 0 => 1


Comment:

Opened PRs for 5.0 https://github.com/django/django/pull/17632 and 4.2
https://github.com/django/django/pull/17633 using Mariusz's fix :)

--
Ticket URL: <https://code.djangoproject.com/ticket/35022#comment:8>

Django

unread,
Dec 22, 2023, 12:27:35 AM12/22/23
to django-...@googlegroups.com
#35022: RenameIndex crashes when there is a unique index on the same fields.
-------------------------------------+-------------------------------------
Reporter: Thomas Capricelli | Owner: David
| Wobrock
Type: Bug | Status: assigned
Component: Migrations | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* has_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/35022#comment:9>

Django

unread,
Dec 22, 2023, 3:53:41 AM12/22/23
to django-...@googlegroups.com
#35022: RenameIndex crashes when there is a unique index on the same fields.
-------------------------------------+-------------------------------------
Reporter: Thomas Capricelli | Owner: David
| Wobrock
Type: Bug | Status: assigned
Component: Migrations | Version: 5.0
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 David Wobrock):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/17635 PR] against main.

--
Ticket URL: <https://code.djangoproject.com/ticket/35022#comment:10>

Django

unread,
Dec 22, 2023, 5:52:16 AM12/22/23
to django-...@googlegroups.com
#35022: RenameIndex crashes when there is a unique index on the same fields.
-------------------------------------+-------------------------------------
Reporter: Thomas Capricelli | Owner: David
| Wobrock
Type: Bug | Status: assigned
Component: Migrations | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/35022#comment:11>

Django

unread,
Dec 22, 2023, 7:25:40 AM12/22/23
to django-...@googlegroups.com
#35022: RenameIndex crashes when there is a unique index on the same fields.
-------------------------------------+-------------------------------------
Reporter: Thomas Capricelli | Owner: David
| Wobrock
Type: Bug | Status: closed
Component: Migrations | Version: 5.0
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"70456610694d24d07d76c64fd3bc40f664be51ea" 70456610]:
{{{
#!CommitTicketReference repository=""
revision="70456610694d24d07d76c64fd3bc40f664be51ea"
Fixed #35022 -- Fixed RenameIndex() crash on unnamed indexes if exists
unique constraint on the same fields.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/35022#comment:12>

Reply all
Reply to author
Forward
0 new messages