#8575 closed (fixed)
get_or_create testcase fails under MySQL
Reported by: | Karen Tracey | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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.
Change History (3)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(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.