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

[release/7.0] Fix bug where a non-sproc command comes before a sproc command #29722

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

roji
Copy link
Member

@roji roji commented Dec 1, 2022

Fixes #29643, #29680

Description

In the new stored procedure mapping support, the logic to count parameters for the purpose of propagating sproc output variables incorrectly assumed all commands in the batch use a sproc. This causes us to propagate the wrong database-generated value into the wrong entity property.

Customer impact

When mixing both stored procedure and non-stored procedure updates in the same SaveChanges batch, database-generated values may cause an exception, or even get assigned to the wrong entity property (bad data).

How found

Customer reported on 7.0

Regression

No.

Testing

Added a test for the affected scenario.

Risk

Low; the fix is quite trivial, and a quirk was added to revert back to older behavior.

@roji roji requested a review from a team December 1, 2022 07:40
@roji roji changed the base branch from main to release/7.0 December 1, 2022 07:40
@roji roji changed the title Fix bug where a non-sproc command comes before a sproc command (#29680) [release/7.0] Fix bug where a non-sproc command comes before a sproc command Dec 1, 2022
@rbhanda rbhanda added this to the 7.0.3 milestone Dec 6, 2022
@wtgodbe wtgodbe merged commit 4f6ca99 into dotnet:release/7.0 Jan 4, 2023
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.

Mixing sproc and non-sproc commands in the same batch may fail with a NullReferenceException
4 participants