diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-16 21:51:38 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-16 22:18:11 -0300 |
commit | 6abe0e7b4e10b8626d1a294eaa5fcaa28ec9f27d (patch) | |
tree | 5c473f97736b03eb4d031d8190d082a545cfcc56 /activerecord/test/cases | |
parent | dbfdd00e38019f9e52df1f74d49a460d8cc1bba5 (diff) | |
download | rails-6abe0e7b4e10b8626d1a294eaa5fcaa28ec9f27d.tar.gz rails-6abe0e7b4e10b8626d1a294eaa5fcaa28ec9f27d.tar.bz2 rails-6abe0e7b4e10b8626d1a294eaa5fcaa28ec9f27d.zip |
Backport explain fixes.
* Mark as SCHEMA some schema database queries. #7648
* Don't explain queries except normal CRUD sql. #7657
Closes #6458
Closes #7544
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/explain_subscriber_test.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/test/cases/explain_subscriber_test.rb b/activerecord/test/cases/explain_subscriber_test.rb index e118add44c..7b852a625d 100644 --- a/activerecord/test/cases/explain_subscriber_test.rb +++ b/activerecord/test/cases/explain_subscriber_test.rb @@ -38,6 +38,13 @@ if ActiveRecord::Base.connection.supports_explain? end end + def test_collects_nothing_if_unexplained_sqls + with_queries([]) do |queries| + SUBSCRIBER.call(:name => 'SQL', :sql => 'SHOW max_identifier_length') + assert queries.empty? + end + end + def with_queries(queries) Thread.current[:available_queries_for_explain] = queries yield queries @@ -45,4 +52,4 @@ if ActiveRecord::Base.connection.supports_explain? Thread.current[:available_queries_for_explain] = nil end end -end
\ No newline at end of file +end |