Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#12977 closed (fixed)

Index length errors running tests on MySQL

Reported by: Carl Meyer Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Greg Taylor, aball@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When running the tests against MySQL (5.1.37-1ubuntu5.1), default configuration, I get this warning:

Failed to install index for model_inheritance_regress.BirthdayParty_attendees model: (1059, "Identifier name 'model_inheritance_regress_birthdayparty_attendees_birthdayparty_id' is too long")
Failed to install index for model_inheritance_regress.BachelorParty_attendees model: (1059, "Identifier name 'model_inheritance_regress_bachelorparty_attendees_bachelorparty_id' is too long")

Doesn't have any real consequences AFAICT (except possibly slowing down those tests somewhat), but I figured it should be logged.

Change History (8)

comment:1 Changed 7 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

comment:2 Changed 7 years ago by Russell Keith-Magee

Component: Testing frameworkDatabase layer (models, ORM)

Actually, the problem isn't just the testing framework; Character limits should be enforced for index creation generally.

comment:3 Changed 7 years ago by Greg Taylor

I've ran into this for one of my projects. I personally use Postgres, which doesn't have this limitation, but some of my users have been complaining about this. Is there any way to manually specify the index name to something shorter?

comment:4 Changed 7 years ago by Greg Taylor

Cc: Greg Taylor added

comment:5 Changed 7 years ago by anonymous

Cc: aball@… added

comment:6 Changed 7 years ago by Russell Keith-Magee

milestone: 1.2

#13434 was a duplicate, contains a patch. That ticket points out that this now more prevalent under 1.2 because m2m fields are now full models with their own indicies; bumping to 1.2 milestone because of this.

comment:7 Changed 7 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [13040]) Fixed #12977 -- Ensure that indexes don't exceed character limits on MySQL. Thanks to carljm for the original report, and hgeerts@… for the patch.

comment:8 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top