#12293: mysql backend raises Warning exceptions for ignorable info notices
------------------------------------------+---------------------------------
 Reporter:  wdoekes                       |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  SVN       
 Keywords:  mysql warnings note           |       Stage:  Unreviewed
Has_patch:  1                             |  
------------------------------------------+---------------------------------
 For example, when I use the custom /sql/mymodel.mysql.sql with something
 like:

 DROP VIEW IF EXISTS `myview`;

 python-mysqldb raises a Database.Warning to warn us of the info that the
 table did not exist.

 {{{
 mysql> drop view if exists myview;
 Query OK, 0 rows affected, 1 warning (0.00 sec)

 mysql> show warnings;
 +-------+------+-----------------------------+
 | Level | Code | Message                     |
 +-------+------+-----------------------------+
 | Note  | 1051 | Unknown table 'mydb.myview' |
 +-------+------+-----------------------------+
 1 row in set (0.00 sec)
 }}}

 This Warning gets propagated when DEBUG==True (because it's not
 filterwarning'd) and then the rest of my custom SQL does not get run.


 I propose a check against 'Note' level warnings, ignoring those. See my
 attached patch.[[BR]]
 (I created a third function to avoid more duplicate code. I don't know if
 this extra call decreases performancy any.)


 Regards,[[BR]]
 Walter Doekes[[BR]]
 OSSO B.V.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12293>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--

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


Reply via email to