Skip to content

Commit

Permalink
fix: add dotnet test for isolation levels
Browse files Browse the repository at this point in the history
Signed-off-by: Tanzeel Khan <[email protected]>
  • Loading branch information
tanscorpio7 committed Aug 28, 2023
1 parent 4757a79 commit 8fb83d2
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
48 changes: 48 additions & 0 deletions test/dotnet/ExpectedOutput/TestIsolationLevel.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#Q#SELECT set_config('babelfishpg_tsql.enable_repeatable_read_isolation_level','on',false)
#D#text
on
#Q#SELECT set_config('babelfishpg_tsql.enable_serializable_isolation_level','off',false)
#D#text
off
#Q#select @@trancount;
#D#int
1
#Q#select current_setting('transaction_isolation')
#D#text
read committed
#Q#select current_setting('default_transaction_isolation')
#D#text
repeatable read
#Q#select @@trancount;
#D#int
0
#Q#select current_setting('transaction_isolation')
#D#text
read committed
#Q#select current_setting('default_transaction_isolation')
#D#text
read committed
#Q#SELECT set_config('babelfishpg_tsql.enable_repeatable_read_isolation_level','off',false)
#D#text
off
#Q#SELECT set_config('babelfishpg_tsql.enable_serializable_isolation_level','on',false)
#D#text
on
#Q#select @@trancount;
#D#int
0
#Q#select current_setting('transaction_isolation')
#D#text
read committed
#Q#select current_setting('default_transaction_isolation')
#D#text
read committed
#Q#select @@trancount;
#D#int
1
#Q#select current_setting('transaction_isolation')
#D#text
read committed
#Q#select current_setting('default_transaction_isolation')
#D#text
serializable
31 changes: 31 additions & 0 deletions test/dotnet/input/Transaction/TestIsolationLevel.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
SELECT set_config('babelfishpg_tsql.enable_repeatable_read_isolation_level','on',false)
SELECT set_config('babelfishpg_tsql.enable_serializable_isolation_level','off',false)

# Begin transaction -> rollback transaction
txn#!#begin#!#isolation#!#rr
select @@trancount;
select current_setting('transaction_isolation')
select current_setting('default_transaction_isolation')
txn#!#rollback

# Begin transaction -> error
txn#!#begin#!#isolation#!#s -- error
select @@trancount;
select current_setting('transaction_isolation')
select current_setting('default_transaction_isolation')

SELECT set_config('babelfishpg_tsql.enable_repeatable_read_isolation_level','off',false)
SELECT set_config('babelfishpg_tsql.enable_serializable_isolation_level','on',false)

# Begin transaction -> error
txn#!#begin#!#isolation#!#rr -- error
select @@trancount;
select current_setting('transaction_isolation')
select current_setting('default_transaction_isolation')

# Begin transaction -> rollback transaction
txn#!#begin#!#isolation#!#s
select @@trancount;
select current_setting('transaction_isolation')
select current_setting('default_transaction_isolation')
txn#!#rollback

0 comments on commit 8fb83d2

Please sign in to comment.