Django

Code

Ticket #8575 (closed: fixed)

Opened 3 months ago

Last modified 3 months ago

get_or_create testcase fails under MySQL

Reported by: kmtracey Assigned to: nobody
Milestone: 1.0 Component: Database layer (models, ORM)
Version: SVN Keywords:
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

As mentioned here: http://groups.google.com/group/django-developers/browse_thread/thread/806b0168b150c8d4?hl=en

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.

Attachments

Change History

08/27/08 14:19:23 changed by jacob

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

08/28/08 23:30:09 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(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 easier.

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


Add/Change #8575 (get_or_create testcase fails under MySQL)




Change Properties
Action