fix(tests): add test for transaction isolation level on mssql #5054
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.
This PR adds a test for transaction isolation levels on Mssql.
On Mssql, isolation levels persist for the duration of a connection, and so the Mssql connection overrides the
isolation_level
transaction option, setting it to a default value, by providing it's own implementation.See https://learn.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql?view=sql-server-ver16#remarks
This test fails for me when running against mssql 2022 with:
From what I can see the default
TransactionCapable::start_transaction()
method is called instead of the Mssql implementation. It's also possible that my test case is incorrect!I'm not sure why this happens, so I am opening this PR to bring attention to this issue and hopefully resolve the bug.