Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#12977 closed (fixed)

Index length errors running tests on MySQL

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


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 6 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 6 years ago by russellm

  • Component changed from Testing framework to Database layer (models, ORM)

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

comment:3 Changed 6 years ago by gtaylor

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 6 years ago by gtaylor

  • Cc gtaylor added

comment:5 Changed 6 years ago by anonymous

  • Cc aball@… added

comment:6 Changed 6 years ago by russellm

  • milestone set to 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 6 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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 deleted

Milestone 1.2 deleted

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