Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Don't try to EXPLAIN select_db calls"

Reason: This was backported, but the test does not pass as is.

This reverts commit a33d320.
  • Loading branch information...
commit 0549ebea223beeb68c09ac9656579f02e893c0f7 1 parent 0be27b7
@fxn fxn authored
View
2  activerecord/lib/active_record/explain_subscriber.rb
@@ -15,7 +15,7 @@ def call(*args)
# On the other hand, we want to monitor the performance of our real database
# queries, not the performance of the access to the query cache.
IGNORED_PAYLOADS = %w(SCHEMA EXPLAIN CACHE)
- EXPLAINED_SQLS = /\A\s*(select|update|delete|insert)\b/i
+ EXPLAINED_SQLS = /\A\s*(select|update|delete|insert)/i
def ignore_payload?(payload)
payload[:exception] || IGNORED_PAYLOADS.include?(payload[:name]) || payload[:sql] !~ EXPLAINED_SQLS
end
View
7 activerecord/test/cases/explain_subscriber_test.rb
@@ -38,13 +38,6 @@ def test_collects_pairs_of_queries_and_binds
end
end
- def test_collects_nothing_if_the_statement_is_only_partially_matched
- with_queries([]) do |queries|
- SUBSCRIBER.finish(:name => 'SQL', :sql => 'select_db yo_mama')
- assert queries.empty?
- end
- end
-
def test_collects_nothing_if_unexplained_sqls
with_queries([]) do |queries|
SUBSCRIBER.call(:name => 'SQL', :sql => 'SHOW max_identifier_length')

0 comments on commit 0549ebe

Please sign in to comment.
Something went wrong with that request. Please try again.