Skip to content

Commit

Permalink
fix: fix python tests for serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
tanscorpio7 committed Aug 24, 2023
1 parent 142e467 commit 6fd9432
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions test/python/expected/pyodbc/BABEL-4145.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

starting permutation : { s1s s1u1 s2u2 s2c s1c }
starting permutation : { s1s s1u1 s2u1 s1c s2c s1s }
step s1s: SELECT * from child ORDER BY child_value ASC;
~~START~~
int#!#int
Expand All @@ -10,14 +10,21 @@ int#!#int
step s1u1: UPDATE child SET child_value = 12 where child_key = 1;
~~ROW COUNT: 1~~

step s2u2: UPDATE child SET child_value = 5 where child_value >= 6
step s2u1: UPDATE child SET child_value = 20 WHERE child_key in (SELECT TOP 1 child_key FROM child ORDER BY child_value DESC)
~~ROW COUNT: 1~~

step s2c: COMMIT;
step s1c: COMMIT;
~~ERROR (Code: 33557097)~~
~~ERROR (Message: [42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]could not serialize access due to read/write dependencies among transactions (33557097) (SQLExecDirectW))~~

step s1c: COMMIT;
step s2c: COMMIT;
step s1s: SELECT * from child ORDER BY child_value ASC;
~~START~~
int#!#int
2#!#10
1#!#12
~~END~~


starting permutation : { s1i s2i s1s s2s s2c s1c }
step s1i: INSERT INTO child VALUES (3, 15);
Expand Down
4 changes: 2 additions & 2 deletions test/python/input/isolation/BABEL-4145.spec
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ setup { SELECT set_config('babelfishpg_tsql.enable_serializable_isolation_leve
set transaction isolation level serializable; BEGIN TRAN; SET lock_timeout '500'; }
step s2s { SELECT * from child ORDER BY child_value ASC; }
step s2i { INSERT INTO child VALUES (4, 20); }
step s2u1 { UPDATE child SET child_value = 11 WHERE child_key in (SELECT TOP 1 child_key FROM child ORDER BY child_value DESC) }
step s2u1 { UPDATE child SET child_value = 20 WHERE child_key in (SELECT TOP 1 child_key FROM child ORDER BY child_value DESC) }
step s2u2 { UPDATE child SET child_value = 5 where child_value >= 6 }
step s2c { COMMIT; }

permutation s1s s1u1 s2u2 s2c s1c
permutation s1s s1u1 s2u1 s1c s2c s1s
permutation s1i s2i s1s s2s s2c s1c
permutation s1u1 s2u2 s1s s1c s2c

0 comments on commit 6fd9432

Please sign in to comment.