Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#8575 closed (fixed)

get_or_create testcase fails under MySQL

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


As mentioned here:

It isn't immediately apparent to me how to easily fix this for MySQL (Oracle guys had a pre-existing routine where they could transform one error to another -- mysql backend doesn't seem to have that). Opening this so it's not forgotten and someone can decide what to do about it and whether it needs to be done before 1.0.

Change History (3)

comment:1 Changed 8 years ago by jacob

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

comment:2 Changed 8 years ago by mtredinnick

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

(In [8692]) Fixed #8575 -- Catch one particular instance of OperationalError in MySQL and
convert it to an IntegrityError, which seems like the more natural case (and is
consistent with other backends). This makes exception handling in Django much

The solution is extensible for any other error codes we may wish to add going

comment:3 Changed 5 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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