infoarts-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-24 01:39 UTC
SQL query different on production server than dev server
I''m having an odd problem on the production server that does not occur in development. I''m using the TextSearch code from here: http://wiki.rubyonrails.org/rails/pages/TextSearch to search on my Product model. In development, when I search for "Ruby Rails" via my form, I get this code: Processing SearchController#results (for 127.0.0.1 at 2007-02-24 12:27:18) [POST] Parameters: {"search_terms_form"=>"ruby rails", "commit"=>"Search", "action"=>"results", "controller"=>"search"} SELECT * FROM products WHERE (((lower(title) like ''%ruby%'' or lower(description) like ''%ruby%'' or lower(author) like ''%ruby%'' or lower(isbn) like ''%ruby%'' or lower(publisher) like ''%ruby%'') and (lower(title) like ''%rails%'' or lower(description) like ''%rails%'' or lower(author) like ''%rails%'' or lower(isbn) like ''%rails%'' or lower(publisher) like ''%rails%''))) However, the very same code in production gives this bizarre code: Processing SearchController#results (for 203.51.51.225 at 2007-02-24 12:24:12) [POST] Parameters: {"search_terms_form"=>"ruby rails", "commit"=>"Search", "action"=>"results", "controller"=>"search"} SELECT * FROM products WHERE (((lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(title))))))))))))))))) like ''%ruby%'' or lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(description))))))))))))))))) like ''%ruby%'' or lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(author))))))))))))))))) like ''%ruby%'' or lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(isbn))))))))))))))))) like ''%ruby%'' or lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(publisher))))))))))))))))) like ''%ruby%'') and (lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(title))))))))))))))))) like ''%rails%'' or lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(description))))))))))))))))) like ''%rails%'' or lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(author))))))))))))))))) like ''%rails%'' or lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(isbn))))))))))))))))) like ''%rails%'' or lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(lower(publisher))))))))))))))))) like ''%rails%''))) Now, the first query runs perfectly. I''m at a loss as to how the same code generates such different queries. Any clues appreciated. Richard Sandilands --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---