Skip to content

Commit 46333d6

Browse files
authored
Merge pull request rails#52446 from jhawthorn/activerecord_log
Keep using log in DatabaseStatements#raw_execute
2 parents f9e2e26 + 173c228 commit 46333d6

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -546,23 +546,10 @@ def internal_exec_query(...) # :nodoc:
546546
# Lowest level way to execute a query. Doesn't check for illegal writes, doesn't annotate queries, yields a native result object.
547547
def raw_execute(sql, name = nil, binds = [], prepare: false, async: false, allow_retry: false, materialize_transactions: true)
548548
type_casted_binds = type_casted_binds(binds)
549-
notification_payload = {
550-
sql: sql,
551-
name: name,
552-
binds: binds,
553-
type_casted_binds: type_casted_binds,
554-
async: async,
555-
connection: self,
556-
transaction: current_transaction.user_transaction.presence,
557-
statement_name: nil,
558-
row_count: 0,
559-
}
560-
@instrumenter.instrument("sql.active_record", notification_payload) do
549+
log(sql, name, binds, type_casted_binds, async: async) do |notification_payload|
561550
with_raw_connection(allow_retry: allow_retry, materialize_transactions: materialize_transactions) do |conn|
562551
perform_query(conn, sql, binds, type_casted_binds, prepare: prepare, notification_payload: notification_payload)
563552
end
564-
rescue ActiveRecord::StatementInvalid => ex
565-
raise ex.set_query(sql, binds)
566553
end
567554
end
568555

0 commit comments

Comments
 (0)