Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add savepoint placeholder for each savepoint created #1179

Merged
merged 3 commits into from
May 17, 2024

Conversation

aidanharan
Copy link
Contributor

Fix DirtyTest#test_partial_update:

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/actions/runs/9127055748/job/25096554308

DirtyTest#test_partial_update [/usr/local/bundle/bundler/gems/rails-fb4300ce193c/activerecord/test/cases/dirty_test.rb:365]:
5 instead of 6 queries were executed. Queries: SAVE TRANSACTION active_record_1

EXEC sp_executesql N'INSERT INTO [pirates] ([catchphrase], [parrot_id], [non_validated_parrot_id], [created_on], [updated_on]) OUTPUT INSERTED.[id] VALUES (@0, @1, @2, @3, @4)', N'@0 nvarchar(4000), @1 int, @2 int, @3 datetime2(6), @4 datetime2(6)', @0 = N'foo', @1 = NULL, @2 = NULL, @3 = '05-17-2024 10:53:27.262222', @4 = '05-17-2024 10:53:27.262222'

SAVE TRANSACTION active_record_1

EXEC sp_executesql N'UPDATE [pirates] SET [catchphrase] = @0, [parrot_id] = @1, [non_validated_parrot_id] = @2, [created_on] = @3, [updated_on] = @4 WHERE [pirates].[id] = @5; SELECT @@ROWCOUNT AS AffectedRows', N'@0 nvarchar(4000), @1 int, @2 int, @3 datetime2(6), @4 datetime2(6), @5 bigint', @0 = N'foo', @1 = NULL, @2 = NULL, @3 = '05-17-2024 10:53:27.262222', @4 = '05-17-2024 10:53:27.263973', @5 = 959118371

/* release savepoint placeholder for testing */.
Expected: 6
  Actual: 5

@aidanharan aidanharan marked this pull request as ready for review May 17, 2024 18:14
@aidanharan aidanharan merged commit a3475a2 into main May 17, 2024
2 of 8 checks passed
@aidanharan aidanharan deleted the multiple-save-point-queries branch May 17, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant