On Mon, 2008-04-07 at 21:49 -0700, shabda wrote:
> I have a  call like,
> 
> crsr = connection.cursor()
> crsr.execute('DROP TABLE IF EXISTS news_linksearch')
> 
> when table news_linksearch does not exists this would lead to a mysql
> warning, (Not an error, as it has a IF EXISTS clause), but this leads
> to a django exception. Should not the behaviour in this case be not
> raising an exception?

MySQL's error/warning system is a little screwy. It shouldn't be raising
any warning at all in this case, since the command works perfectly all
the time. Django handles any non-normal return value as an error, since
it doesn't promote anything corresponding to a "warning" from the
database backends. Feel free to submit a patch if you can think of a
sensible, portable way to handle that, but bear in mind that sometimes
MySQL emits warnings for things that really are error conditions, so we
cannot just ignore all warnings (as I said, MySQL's system is a little
messed up).

Malcolm

-- 
Two wrongs are only the beginning. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to