nesquena/query_reviewer — Issue #14: error upgrading to Rails 3.2
Author: dgilperez
Created: 2012-03-02 22:58:09+00:00
State: open

Hi!

I'm upgrading my rails 3.1 app to 3.2. I have been experiencing some weirdness I believe related to the query_reviewer

`````
(0.2ms) SET PROFILING=1
Measurement Load (0.8ms) SELECT SQL_NO_CACHE `houses`.* FROM `houses` INNER JOIN `lanes` ON `lanes`.`id` = `houses`.`variable_id` WHERE `lanes`.`name` = 'weight' AND `houses`.`user_id` = 23 ORDER BY date DESC LIMIT 1
EXPLAIN (25.5ms) EXPLAIN SET PROFILING=1
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET PROFILING=1' at line 1: EXPLAIN SET PROFILING=1
Completed 500 Internal Server Error in 803ms

`````

It seems Rails is confusing the query that has to EXPLAIN. This happens with many slow queries and works good with Rails 3.1 or by removing query_reviewer in Rails 3.2.

I use ``query_reviewer``a lot and find it really helpful, so any ideas will be appreciated!

thanks for the effort put into this,

David