summaryrefslogtreecommitdiffstats
path: root/src/test/isolation/expected/merge-match-recheck.out
blob: 9a44a5959270b796aa4b1661ab06ee833c695cc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
Parsed test spec with 2 sessions

starting permutation: update1 merge_status c2 select1 c1
step update1: UPDATE target t SET balance = balance + 10, val = t.val || ' updated by update1' WHERE t.key = 1;
step merge_status: 
  MERGE INTO target t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND status = 's1' THEN
	UPDATE SET status = 's2', val = t.val || ' when1'
  WHEN MATCHED AND status = 's2' THEN
	UPDATE SET status = 's3', val = t.val || ' when2'
  WHEN MATCHED AND status = 's3' THEN
	UPDATE SET status = 's4', val = t.val || ' when3';
 <waiting ...>
step c2: COMMIT;
step merge_status: <... completed>
step select1: SELECT * FROM target;
key|balance|status|val                           
---+-------+------+------------------------------
  1|    170|s2    |setup updated by update1 when1
(1 row)

step c1: COMMIT;

starting permutation: update1_tg merge_status_tg c2 select1_tg c1
s2: NOTICE:  Update: (1,160,s1,setup) -> (1,170,s1,"setup updated by update1_tg")
step update1_tg: UPDATE target_tg t SET balance = balance + 10, val = t.val || ' updated by update1_tg' WHERE t.key = 1;
step merge_status_tg: 
  MERGE INTO target_tg t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND status = 's1' THEN
	UPDATE SET status = 's2', val = t.val || ' when1'
  WHEN MATCHED AND status = 's2' THEN
	UPDATE SET status = 's3', val = t.val || ' when2'
  WHEN MATCHED AND status = 's3' THEN
	UPDATE SET status = 's4', val = t.val || ' when3';
 <waiting ...>
step c2: COMMIT;
s1: NOTICE:  Update: (1,170,s1,"setup updated by update1_tg") -> (1,170,s2,"setup updated by update1_tg when1")
step merge_status_tg: <... completed>
step select1_tg: SELECT * FROM target_tg;
key|balance|status|val                              
---+-------+------+---------------------------------
  1|    170|s2    |setup updated by update1_tg when1
(1 row)

step c1: COMMIT;

starting permutation: update2 merge_status c2 select1 c1
step update2: UPDATE target t SET status = 's2', val = t.val || ' updated by update2' WHERE t.key = 1;
step merge_status: 
  MERGE INTO target t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND status = 's1' THEN
	UPDATE SET status = 's2', val = t.val || ' when1'
  WHEN MATCHED AND status = 's2' THEN
	UPDATE SET status = 's3', val = t.val || ' when2'
  WHEN MATCHED AND status = 's3' THEN
	UPDATE SET status = 's4', val = t.val || ' when3';
 <waiting ...>
step c2: COMMIT;
step merge_status: <... completed>
step select1: SELECT * FROM target;
key|balance|status|val                           
---+-------+------+------------------------------
  1|    160|s3    |setup updated by update2 when2
(1 row)

step c1: COMMIT;

starting permutation: update2_tg merge_status_tg c2 select1_tg c1
s2: NOTICE:  Update: (1,160,s1,setup) -> (1,160,s2,"setup updated by update2_tg")
step update2_tg: UPDATE target_tg t SET status = 's2', val = t.val || ' updated by update2_tg' WHERE t.key = 1;
step merge_status_tg: 
  MERGE INTO target_tg t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND status = 's1' THEN
	UPDATE SET status = 's2', val = t.val || ' when1'
  WHEN MATCHED AND status = 's2' THEN
	UPDATE SET status = 's3', val = t.val || ' when2'
  WHEN MATCHED AND status = 's3' THEN
	UPDATE SET status = 's4', val = t.val || ' when3';
 <waiting ...>
step c2: COMMIT;
s1: NOTICE:  Update: (1,160,s2,"setup updated by update2_tg") -> (1,160,s3,"setup updated by update2_tg when2")
step merge_status_tg: <... completed>
step select1_tg: SELECT * FROM target_tg;
key|balance|status|val                              
---+-------+------+---------------------------------
  1|    160|s3    |setup updated by update2_tg when2
(1 row)

step c1: COMMIT;

starting permutation: update3 merge_status c2 select1 c1
step update3: UPDATE target t SET status = 's3', val = t.val || ' updated by update3' WHERE t.key = 1;
step merge_status: 
  MERGE INTO target t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND status = 's1' THEN
	UPDATE SET status = 's2', val = t.val || ' when1'
  WHEN MATCHED AND status = 's2' THEN
	UPDATE SET status = 's3', val = t.val || ' when2'
  WHEN MATCHED AND status = 's3' THEN
	UPDATE SET status = 's4', val = t.val || ' when3';
 <waiting ...>
step c2: COMMIT;
step merge_status: <... completed>
step select1: SELECT * FROM target;
key|balance|status|val                           
---+-------+------+------------------------------
  1|    160|s4    |setup updated by update3 when3
(1 row)

step c1: COMMIT;

starting permutation: update3_tg merge_status_tg c2 select1_tg c1
s2: NOTICE:  Update: (1,160,s1,setup) -> (1,160,s3,"setup updated by update3_tg")
step update3_tg: UPDATE target_tg t SET status = 's3', val = t.val || ' updated by update3_tg' WHERE t.key = 1;
step merge_status_tg: 
  MERGE INTO target_tg t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND status = 's1' THEN
	UPDATE SET status = 's2', val = t.val || ' when1'
  WHEN MATCHED AND status = 's2' THEN
	UPDATE SET status = 's3', val = t.val || ' when2'
  WHEN MATCHED AND status = 's3' THEN
	UPDATE SET status = 's4', val = t.val || ' when3';
 <waiting ...>
step c2: COMMIT;
s1: NOTICE:  Update: (1,160,s3,"setup updated by update3_tg") -> (1,160,s4,"setup updated by update3_tg when3")
step merge_status_tg: <... completed>
step select1_tg: SELECT * FROM target_tg;
key|balance|status|val                              
---+-------+------+---------------------------------
  1|    160|s4    |setup updated by update3_tg when3
(1 row)

step c1: COMMIT;

starting permutation: update5 merge_status c2 select1 c1
step update5: UPDATE target t SET status = 's5', val = t.val || ' updated by update5' WHERE t.key = 1;
step merge_status: 
  MERGE INTO target t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND status = 's1' THEN
	UPDATE SET status = 's2', val = t.val || ' when1'
  WHEN MATCHED AND status = 's2' THEN
	UPDATE SET status = 's3', val = t.val || ' when2'
  WHEN MATCHED AND status = 's3' THEN
	UPDATE SET status = 's4', val = t.val || ' when3';
 <waiting ...>
step c2: COMMIT;
step merge_status: <... completed>
step select1: SELECT * FROM target;
key|balance|status|val                     
---+-------+------+------------------------
  1|    160|s5    |setup updated by update5
(1 row)

step c1: COMMIT;

starting permutation: update5_tg merge_status_tg c2 select1_tg c1
s2: NOTICE:  Update: (1,160,s1,setup) -> (1,160,s5,"setup updated by update5_tg")
step update5_tg: UPDATE target_tg t SET status = 's5', val = t.val || ' updated by update5_tg' WHERE t.key = 1;
step merge_status_tg: 
  MERGE INTO target_tg t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND status = 's1' THEN
	UPDATE SET status = 's2', val = t.val || ' when1'
  WHEN MATCHED AND status = 's2' THEN
	UPDATE SET status = 's3', val = t.val || ' when2'
  WHEN MATCHED AND status = 's3' THEN
	UPDATE SET status = 's4', val = t.val || ' when3';
 <waiting ...>
step c2: COMMIT;
step merge_status_tg: <... completed>
step select1_tg: SELECT * FROM target_tg;
key|balance|status|val                        
---+-------+------+---------------------------
  1|    160|s5    |setup updated by update5_tg
(1 row)

step c1: COMMIT;

starting permutation: update_bal1 merge_bal c2 select1 c1
step update_bal1: UPDATE target t SET balance = 50, val = t.val || ' updated by update_bal1' WHERE t.key = 1;
step merge_bal: 
  MERGE INTO target t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND balance < 100 THEN
	UPDATE SET balance = balance * 2, val = t.val || ' when1'
  WHEN MATCHED AND balance < 200 THEN
	UPDATE SET balance = balance * 4, val = t.val || ' when2'
  WHEN MATCHED AND balance < 300 THEN
	UPDATE SET balance = balance * 8, val = t.val || ' when3';
 <waiting ...>
step c2: COMMIT;
step merge_bal: <... completed>
step select1: SELECT * FROM target;
key|balance|status|val                               
---+-------+------+----------------------------------
  1|    100|s1    |setup updated by update_bal1 when1
(1 row)

step c1: COMMIT;

starting permutation: update_bal1_pa merge_bal_pa c2 select1_pa c1
step update_bal1_pa: UPDATE target_pa t SET balance = 50, val = t.val || ' updated by update_bal1_pa' WHERE t.key = 1;
step merge_bal_pa: 
  MERGE INTO target_pa t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND balance < 100 THEN
	UPDATE SET balance = balance * 2, val = t.val || ' when1'
  WHEN MATCHED AND balance < 200 THEN
	UPDATE SET balance = balance * 4, val = t.val || ' when2'
  WHEN MATCHED AND balance < 300 THEN
	UPDATE SET balance = balance * 8, val = t.val || ' when3';
 <waiting ...>
step c2: COMMIT;
step merge_bal_pa: <... completed>
step select1_pa: SELECT * FROM target_pa;
key|balance|status|val                                  
---+-------+------+-------------------------------------
  1|    100|s1    |setup updated by update_bal1_pa when1
(1 row)

step c1: COMMIT;

starting permutation: update_bal1_tg merge_bal_tg c2 select1_tg c1
s2: NOTICE:  Update: (1,160,s1,setup) -> (1,50,s1,"setup updated by update_bal1_tg")
step update_bal1_tg: UPDATE target_tg t SET balance = 50, val = t.val || ' updated by update_bal1_tg' WHERE t.key = 1;
step merge_bal_tg: 
  MERGE INTO target_tg t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND balance < 100 THEN
	UPDATE SET balance = balance * 2, val = t.val || ' when1'
  WHEN MATCHED AND balance < 200 THEN
	UPDATE SET balance = balance * 4, val = t.val || ' when2'
  WHEN MATCHED AND balance < 300 THEN
	UPDATE SET balance = balance * 8, val = t.val || ' when3';
 <waiting ...>
step c2: COMMIT;
s1: NOTICE:  Update: (1,50,s1,"setup updated by update_bal1_tg") -> (1,100,s1,"setup updated by update_bal1_tg when1")
step merge_bal_tg: <... completed>
step select1_tg: SELECT * FROM target_tg;
key|balance|status|val                                  
---+-------+------+-------------------------------------
  1|    100|s1    |setup updated by update_bal1_tg when1
(1 row)

step c1: COMMIT;

starting permutation: update1 merge_delete c2 select1 c1
step update1: UPDATE target t SET balance = balance + 10, val = t.val || ' updated by update1' WHERE t.key = 1;
step merge_delete: 
  MERGE INTO target t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND balance < 100 THEN
	UPDATE SET balance = balance * 2, val = t.val || ' when1'
  WHEN MATCHED AND balance < 200 THEN
    DELETE;
 <waiting ...>
step c2: COMMIT;
step merge_delete: <... completed>
step select1: SELECT * FROM target;
key|balance|status|val
---+-------+------+---
(0 rows)

step c1: COMMIT;

starting permutation: update1_tg merge_delete_tg c2 select1_tg c1
s2: NOTICE:  Update: (1,160,s1,setup) -> (1,170,s1,"setup updated by update1_tg")
step update1_tg: UPDATE target_tg t SET balance = balance + 10, val = t.val || ' updated by update1_tg' WHERE t.key = 1;
step merge_delete_tg: 
  MERGE INTO target_tg t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND balance < 100 THEN
	UPDATE SET balance = balance * 2, val = t.val || ' when1'
  WHEN MATCHED AND balance < 200 THEN
    DELETE;
 <waiting ...>
step c2: COMMIT;
s1: NOTICE:  Delete: (1,170,s1,"setup updated by update1_tg")
step merge_delete_tg: <... completed>
step select1_tg: SELECT * FROM target_tg;
key|balance|status|val
---+-------+------+---
(0 rows)

step c1: COMMIT;

starting permutation: update_bal1 merge_delete c2 select1 c1
step update_bal1: UPDATE target t SET balance = 50, val = t.val || ' updated by update_bal1' WHERE t.key = 1;
step merge_delete: 
  MERGE INTO target t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND balance < 100 THEN
	UPDATE SET balance = balance * 2, val = t.val || ' when1'
  WHEN MATCHED AND balance < 200 THEN
    DELETE;
 <waiting ...>
step c2: COMMIT;
step merge_delete: <... completed>
step select1: SELECT * FROM target;
key|balance|status|val                               
---+-------+------+----------------------------------
  1|    100|s1    |setup updated by update_bal1 when1
(1 row)

step c1: COMMIT;

starting permutation: update_bal1_tg merge_delete_tg c2 select1_tg c1
s2: NOTICE:  Update: (1,160,s1,setup) -> (1,50,s1,"setup updated by update_bal1_tg")
step update_bal1_tg: UPDATE target_tg t SET balance = 50, val = t.val || ' updated by update_bal1_tg' WHERE t.key = 1;
step merge_delete_tg: 
  MERGE INTO target_tg t
  USING (SELECT 1 as key) s
  ON s.key = t.key
  WHEN MATCHED AND balance < 100 THEN
	UPDATE SET balance = balance * 2, val = t.val || ' when1'
  WHEN MATCHED AND balance < 200 THEN
    DELETE;
 <waiting ...>
step c2: COMMIT;
s1: NOTICE:  Update: (1,50,s1,"setup updated by update_bal1_tg") -> (1,100,s1,"setup updated by update_bal1_tg when1")
step merge_delete_tg: <... completed>
step select1_tg: SELECT * FROM target_tg;
key|balance|status|val                                  
---+-------+------+-------------------------------------
  1|    100|s1    |setup updated by update_bal1_tg when1
(1 row)

step c1: COMMIT;