Fix SNAPSHOT ISOLATION detection in SQL Server #7555
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously we were checking the flag set with
ALTER DATABASE ... SET READ_COMMITTED_SNAPSHOT ...
instead of the one set withALTER DATABASE ... SET ALLOW_SNAPSHOT_ISOLATION ...
. The two flags are related, butnot the same. More explanation at
https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/snapshot-isolation-in-sql-server#snapshot-isolation-level-extensions
This also simplifies the
TestingSqlServer
setup and improves coverage of snapshot isolation tests.TestingSqlServer
still enables snapshot isolation by default, toavoid regular tests being flaky on CI (as in
Sporadic query failures due to a deadlock in SqlServerClient.getTableProperties: "Transaction was deadlocked ... and has been chosen as the deadlock victim" #6389). The
READ_COMMITTED_SNAPSHOT
is enabled by default as well.ALLOW_SNAPSHOT_ISOLATION
andREAD_COMMITTED_SNAPSHOT
options.These tests do not leverage
BaseConnectorSmokeTest
as this couldre-introduce flakiness on CI.
Fixes #7548