Skip to content

Commit f3cff55

Browse files
committed
Fix test_payload_row_count_on_raw_sql_coerced
1 parent bc44d41 commit f3cff55

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/active_record/connection_adapters/sqlserver/database_statements.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ def write_query?(sql) # :nodoc:
1414
end
1515

1616
def raw_execute(sql, name, async: false, allow_retry: false, materialize_transactions: true)
17-
log(sql, name, async: async) do
17+
log(sql, name, async: async) do |notification_payload|
1818
with_raw_connection(allow_retry: allow_retry, materialize_transactions: materialize_transactions) do |conn|
1919
result = if id_insert_table_name = query_requires_identity_insert?(sql)
2020
with_identity_insert_enabled(id_insert_table_name, conn) { internal_raw_execute(sql, conn, perform_do: true) }
2121
else
2222
internal_raw_execute(sql, conn, perform_do: true)
2323
end
2424
verified!
25+
notification_payload[:row_count] = result
2526
result
2627
end
2728
end

test/cases/coerced_tests.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def test_payload_row_count_on_pluck_coerced
373373
Book.where(author_id: nil, name: 'row count book 2').delete_all
374374
Book.lease_connection.add_index(:books, [:author_id, :name], unique: true)
375375
end
376-
376+
377377
# Need to remove index as SQL Server considers NULLs on a unique-index to be equal unlike PostgreSQL/MySQL/SQLite.
378378
coerce_tests! :test_payload_row_count_on_raw_sql
379379
def test_payload_row_count_on_raw_sql_coerced

0 commit comments

Comments
 (0)