#11209: connection.queries reports different SQL query than MySQL log
------------------------------------------+---------------------------------
 Reporter:  creecode                      |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  1.0       
 Keywords:                                |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 I'm using MySQL 5.0.x and Django v1.0.2.

 The QuerySet...

 {{{ Entry.objects.filter ( content__search = 'heat pipes' ) }}}

 ...is producing this SQL...

 SELECT `my_app_entry`.`id`, `my_app_entry`.`title`,
 `my_app_entry`.`content`, `my_app_entry`.`url`, `my_app_entry`.`created`,
 `my_app_entry`.`modified`, `my_app_entry`.`website_id` FROM `my_app_entry`
 WHERE MATCH (`my_app_entry`.`content`) AGAINST (heat pipes IN BOOLEAN
 MODE) LIMIT 21

 ...as reported from connection.queries.  I seem to be getting results back
 with no reports of errors but if you look closely at the above SQL you'll
 see there is a syntax error.  I verified this by putting the above SQL
 into a client app that tried to run the above SQL and received an error.

 At this point I was a bit confused and took a look at the MySQL log and it
 reported...

 SELECT `my_app_entry`.`id`, `my_app_entry`.`title`,
 `my_app_entry`.`content`, `my_app_entry`.`url`, `my_app_entry`.`created`,
 `my_app_entry`.`modified`, `my_app_entry`.`website_id` FROM `my_app_entry`
 WHERE MATCH (`my_app_entry`.`content`) AGAINST ('heat pipes' IN BOOLEAN
 MODE) LIMIT 21

 You'll notice that the query string in the SQL here is properly single
 quoted.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11209>
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