[Django] #27935: BrinIndex.suffix for postgres longer 3 char

34 views
Skip to first unread message

Django

unread,
Mar 13, 2017, 3:09:39 AM3/13/17
to django-...@googlegroups.com
#27935: BrinIndex.suffix for postgres longer 3 char
--------------------------------------------+------------------------
Reporter: Den | Owner: (none)
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------------+------------------------
BrinIndex.suffix ( django.contrib.postgres.indexes) longer 3 char, but
Index.set_name_with_model method allowed 3 char in suffix

AssertionError: Index too long for multiple database support. Is
self.suffix longer than 3 characters?

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

Django

unread,
Mar 13, 2017, 6:14:40 AM3/13/17
to django-...@googlegroups.com
#27935: BrinIndex.suffix for postgres longer 3 char
----------------------------------+------------------------------------

Reporter: Den | Owner: (none)
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.11
Severity: Release blocker | 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 Markus Holtermann):

* severity: Normal => Release blocker
* stage: Unreviewed => Accepted


Comment:

There are no tests for auto-generated index names as there are for
GinIndex:
https://github.com/django/django/blob/master/tests/postgres_tests/test_indexes.py#L61-L64

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

Django

unread,
Mar 13, 2017, 7:50:29 AM3/13/17
to django-...@googlegroups.com
#27935: BrinIndex.suffix for postgres longer 3 char
----------------------------------+------------------------------------

Reporter: Den | Owner: (none)
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.11
Severity: Release blocker | 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 felixxm):

* cc: felisiak.mariusz@… (added)


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

Django

unread,
Mar 13, 2017, 8:40:48 AM3/13/17
to django-...@googlegroups.com
#27935: BrinIndex.suffix for postgres longer 3 char
----------------------------------+------------------------------------

Reporter: Den | Owner: (none)
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.11
Severity: Release blocker | 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 Mads Jensen):

The current model wasn't actually enough to trigger a failure for the
auto-generated name as the length of the indexed field is only 5
characters.

Either changing `suffix = brin` to `suffix = `brn`, or removing a
character from the hash so it's just five characters. Probably the first
is better?

{{{#!python
def test_name_auto_generation_fail(self):
# name of field must be at least 7 characters long to get to 30
characters
index = BrinIndex(fields=['datetimes'])
index.set_name_with_model(DateTimeArrayModel)
self.assertEqual(index.name, 'postgres_te_datetim_b1e2ca_brn')

}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:3>

Django

unread,
Mar 16, 2017, 7:29:17 AM3/16/17
to django-...@googlegroups.com
#27935: BrinIndex.suffix for postgres longer 3 char
----------------------------------+------------------------------------

Reporter: Den | Owner: (none)
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.11
Severity: Release blocker | 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 Mads Jensen):

* has_patch: 0 => 1


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:4>

Django

unread,
Mar 18, 2017, 8:47:36 AM3/18/17
to django-...@googlegroups.com
#27935: BrinIndex crashes if name > 30 characters
-------------------------------------+-------------------------------------

Reporter: Den | Owner: (none)
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.11
Severity: Release blocker | 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 Tim Graham):

* stage: Accepted => Ready for checkin


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

Django

unread,
Mar 18, 2017, 8:47:54 AM3/18/17
to django-...@googlegroups.com
#27935: BrinIndex crashes if name > 30 characters
-------------------------------------+-------------------------------------
Reporter: Den | Owner: Tim
| Graham <timograham@…>
Type: Bug | Status: closed
Component: contrib.postgres | Version: 1.11
Severity: Release blocker | 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 Tim Graham <timograham@…>):

* status: new => closed
* owner: (none) => Tim Graham <timograham@…>
* resolution: => fixed


Comment:

In [changeset:"82bb4e684f9d0e5939cb0596c249954df0888e2d" 82bb4e68]:
{{{
#!CommitTicketReference repository=""
revision="82bb4e684f9d0e5939cb0596c249954df0888e2d"
Fixed #27935 -- Fixed crash with BrinIndex name > 30 characters.
}}}

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

Django

unread,
Mar 18, 2017, 8:55:41 AM3/18/17
to django-...@googlegroups.com
#27935: BrinIndex crashes if name > 30 characters
-------------------------------------+-------------------------------------
Reporter: Den | Owner: Tim
| Graham <timograham@…>
Type: Bug | Status: closed
Component: contrib.postgres | Version: 1.11

Severity: Release blocker | 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
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"0b93a992e50ebe455e46d261cb6a741bba1ad76e" 0b93a992]:
{{{
#!CommitTicketReference repository=""
revision="0b93a992e50ebe455e46d261cb6a741bba1ad76e"
[1.11.x] Fixed #27935 -- Fixed crash with BrinIndex name > 30 characters.

Backport of 82bb4e684f9d0e5939cb0596c249954df0888e2d from master
}}}

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

Django

unread,
Mar 18, 2017, 9:20:06 AM3/18/17
to django-...@googlegroups.com
#27935: BrinIndex crashes if name > 30 characters
-------------------------------------+-------------------------------------
Reporter: Den | Owner: Tim
| Graham <timograham@…>
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.11
Severity: Release blocker | 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 Tim Graham):

* status: closed => new
* has_patch: 1 => 0
* resolution: fixed =>
* stage: Ready for checkin => Accepted


Comment:

Florian pointed out on IRC that in a mixed database setup,
`connection.ops.max_name_length()` won't necessarily be a PostgreSQL
connection. Maybe that could use the
`db.backends.postgresql.operations.DatabaseOperations` class instead.

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

Django

unread,
Mar 20, 2017, 11:21:27 AM3/20/17
to django-...@googlegroups.com
#27935: BrinIndex crashes if name > 30 characters
-------------------------------------+-------------------------------------
Reporter: Den | Owner: Tim
| Graham <timograham@…>
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.11
Severity: Release blocker | 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 Tim Graham <timograham@…>):

In [changeset:"2867b7eb4b8477710f11707d4b975db10e5f91a7" 2867b7eb]:
{{{
#!CommitTicketReference repository=""
revision="2867b7eb4b8477710f11707d4b975db10e5f91a7"
Refs #27935 -- Fixed BrinIndex.max_name_length if a project's default
database isn't PostgreSQL.

Thanks Florian Apolloner for the report.
}}}

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

Django

unread,
Mar 20, 2017, 11:29:48 AM3/20/17
to django-...@googlegroups.com
#27935: BrinIndex crashes if name > 30 characters
-------------------------------------+-------------------------------------
Reporter: Den | Owner: Tim
| Graham <timograham@…>
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.11
Severity: Release blocker | 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 Tim Graham <timograham@…>):

In [changeset:"40b843488a1c4f2fab8e3ab895718a867cc00133" 40b84348]:
{{{
#!CommitTicketReference repository=""
revision="40b843488a1c4f2fab8e3ab895718a867cc00133"
[1.11.x] Refs #27935 -- Fixed BrinIndex.max_name_length if a project's


default database isn't PostgreSQL.

Thanks Florian Apolloner for the report.

Backport of 2867b7eb4b8477710f11707d4b975db10e5f91a7 from master
}}}

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

Django

unread,
Mar 20, 2017, 11:30:06 AM3/20/17
to django-...@googlegroups.com
#27935: BrinIndex crashes if name > 30 characters
-------------------------------------+-------------------------------------
Reporter: Den | Owner: Tim
| Graham <timograham@…>
Type: Bug | Status: closed
Component: contrib.postgres | Version: 1.11

Severity: Release blocker | Resolution: fixed
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 Tim Graham):

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


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

Reply all
Reply to author
Forward
0 new messages