Re: mysql warnings raise exception

179 views
Skip to first unread message

Derek

unread,
Jul 12, 2012, 3:30:55 AM7/12/12
to django...@googlegroups.com
George

When issues with existing bugs get raised on this list. someone from "higher up" usually suggests you need to post on the developers list (apologies if you have already done; I do not subscribe to that list).

Derek

On Tuesday, 10 July 2012 19:10:54 UTC+2, George Lund wrote:
I notice that this problem gets discussed occasionally but with no proper resolution, so I felt obliged to raise it again, as the consequences are quite serious for MySQL users.

When MySQL issues a warning, Django sometimes raises an exception. This is discussed in https://code.djangoproject.com/ticket/12293, which is marked as wontfix.

The main problem is that the behaviour is different depending whether DEBUG is True or not. This leads to problems with testing and deployment that in an extreme case could cause data loss.

A secondary problem is that the exception in question isn't being caught and re-thrown as a Django exception, so that code that wants to deal with such scenarios must catch a MySQL-specific exception, tying us to the one database back-end.

For me, the right choice would be to make this configurable, and completely independent of the DEBUG setting. The right default would be to ignore warnings, as in general that's how most programs coding against MySQL would expect to treat them. Most people I would argue would expect a warning to be ignored and for processing to continue.

*Please* can this wontfix be re-considered -- the interwebs appear to be full of people getting caught out by this (if it will help the case, I can list numerous references!)

TIA

George

Reply all
Reply to author
Forward
0 new messages