diff options
Diffstat (limited to 'src/test/isolation/expected/merge-insert-update.out')
-rw-r--r-- | src/test/isolation/expected/merge-insert-update.out | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/test/isolation/expected/merge-insert-update.out b/src/test/isolation/expected/merge-insert-update.out new file mode 100644 index 0000000..ee8b3c4 --- /dev/null +++ b/src/test/isolation/expected/merge-insert-update.out @@ -0,0 +1,94 @@ +Parsed test spec with 2 sessions + +starting permutation: merge1 c1 select2 c2 +step merge1: MERGE INTO target t USING (SELECT 1 as key, 'merge1' as val) s ON s.key = t.key WHEN NOT MATCHED THEN INSERT VALUES (s.key, s.val) WHEN MATCHED THEN UPDATE set val = t.val || ' updated by merge1'; +step c1: COMMIT; +step select2: SELECT * FROM target; +key|val +---+------ + 1|merge1 +(1 row) + +step c2: COMMIT; + +starting permutation: merge1 c1 merge2 select2 c2 +step merge1: MERGE INTO target t USING (SELECT 1 as key, 'merge1' as val) s ON s.key = t.key WHEN NOT MATCHED THEN INSERT VALUES (s.key, s.val) WHEN MATCHED THEN UPDATE set val = t.val || ' updated by merge1'; +step c1: COMMIT; +step merge2: MERGE INTO target t USING (SELECT 1 as key, 'merge2' as val) s ON s.key = t.key WHEN NOT MATCHED THEN INSERT VALUES (s.key, s.val) WHEN MATCHED THEN UPDATE set val = t.val || ' updated by merge2'; +step select2: SELECT * FROM target; +key|val +---+------------------------ + 1|merge1 updated by merge2 +(1 row) + +step c2: COMMIT; + +starting permutation: insert1 merge2 c1 select2 c2 +step insert1: INSERT INTO target VALUES (1, 'insert1'); +step merge2: MERGE INTO target t USING (SELECT 1 as key, 'merge2' as val) s ON s.key = t.key WHEN NOT MATCHED THEN INSERT VALUES (s.key, s.val) WHEN MATCHED THEN UPDATE set val = t.val || ' updated by merge2'; <waiting ...> +step c1: COMMIT; +step merge2: <... completed> +ERROR: duplicate key value violates unique constraint "target_pkey" +step select2: SELECT * FROM target; +ERROR: current transaction is aborted, commands ignored until end of transaction block +step c2: COMMIT; + +starting permutation: merge1 merge2 c1 select2 c2 +step merge1: MERGE INTO target t USING (SELECT 1 as key, 'merge1' as val) s ON s.key = t.key WHEN NOT MATCHED THEN INSERT VALUES (s.key, s.val) WHEN MATCHED THEN UPDATE set val = t.val || ' updated by merge1'; +step merge2: MERGE INTO target t USING (SELECT 1 as key, 'merge2' as val) s ON s.key = t.key WHEN NOT MATCHED THEN INSERT VALUES (s.key, s.val) WHEN MATCHED THEN UPDATE set val = t.val || ' updated by merge2'; <waiting ...> +step c1: COMMIT; +step merge2: <... completed> +ERROR: duplicate key value violates unique constraint "target_pkey" +step select2: SELECT * FROM target; +ERROR: current transaction is aborted, commands ignored until end of transaction block +step c2: COMMIT; + +starting permutation: merge1 merge2 a1 select2 c2 +step merge1: MERGE INTO target t USING (SELECT 1 as key, 'merge1' as val) s ON s.key = t.key WHEN NOT MATCHED THEN INSERT VALUES (s.key, s.val) WHEN MATCHED THEN UPDATE set val = t.val || ' updated by merge1'; +step merge2: MERGE INTO target t USING (SELECT 1 as key, 'merge2' as val) s ON s.key = t.key WHEN NOT MATCHED THEN INSERT VALUES (s.key, s.val) WHEN MATCHED THEN UPDATE set val = t.val || ' updated by merge2'; <waiting ...> +step a1: ABORT; +step merge2: <... completed> +step select2: SELECT * FROM target; +key|val +---+------ + 1|merge2 +(1 row) + +step c2: COMMIT; + +starting permutation: delete1 insert1 c1 merge2 select2 c2 +step delete1: DELETE FROM target WHERE key = 1; +step insert1: INSERT INTO target VALUES (1, 'insert1'); +step c1: COMMIT; +step merge2: MERGE INTO target t USING (SELECT 1 as key, 'merge2' as val) s ON s.key = t.key WHEN NOT MATCHED THEN INSERT VALUES (s.key, s.val) WHEN MATCHED THEN UPDATE set val = t.val || ' updated by merge2'; +step select2: SELECT * FROM target; +key|val +---+------------------------- + 1|insert1 updated by merge2 +(1 row) + +step c2: COMMIT; + +starting permutation: delete1 insert1 merge2 c1 select2 c2 +step delete1: DELETE FROM target WHERE key = 1; +step insert1: INSERT INTO target VALUES (1, 'insert1'); +step merge2: MERGE INTO target t USING (SELECT 1 as key, 'merge2' as val) s ON s.key = t.key WHEN NOT MATCHED THEN INSERT VALUES (s.key, s.val) WHEN MATCHED THEN UPDATE set val = t.val || ' updated by merge2'; <waiting ...> +step c1: COMMIT; +step merge2: <... completed> +ERROR: duplicate key value violates unique constraint "target_pkey" +step select2: SELECT * FROM target; +ERROR: current transaction is aborted, commands ignored until end of transaction block +step c2: COMMIT; + +starting permutation: delete1 insert1 merge2i c1 select2 c2 +step delete1: DELETE FROM target WHERE key = 1; +step insert1: INSERT INTO target VALUES (1, 'insert1'); +step merge2i: MERGE INTO target t USING (SELECT 1 as key, 'merge2' as val) s ON s.key = t.key WHEN MATCHED THEN UPDATE set val = t.val || ' updated by merge2'; +step c1: COMMIT; +step select2: SELECT * FROM target; +key|val +---+------- + 1|insert1 +(1 row) + +step c2: COMMIT; |