Debian Codegraph @

src/test/isolation/specs/reindex-concurrently.spec

raw
1 # REINDEX CONCURRENTLY
2 #
3 # Ensure that concurrent operations work correctly when a REINDEX is performed
4 # concurrently.
5
6 setup
7 {
8 CREATE TABLE reind_con_tab(id serial primary key, data text);
9 INSERT INTO reind_con_tab(data) VALUES ('aa');
10 INSERT INTO reind_con_tab(data) VALUES ('aaa');
11 INSERT INTO reind_con_tab(data) VALUES ('aaaa');
12 INSERT INTO reind_con_tab(data) VALUES ('aaaaa');
13 }
14
15 teardown
16 {
17 DROP TABLE reind_con_tab;
18 }
19
20 session s1
21 setup { BEGIN; }
22 step sel1 { SELECT data FROM reind_con_tab WHERE id = 3; }
23 step end1 { COMMIT; }
24
25 session s2
26 setup { BEGIN; }
27 step upd2 { UPDATE reind_con_tab SET data = 'bbbb' WHERE id = 3; }
28 step ins2 { INSERT INTO reind_con_tab(data) VALUES ('cccc'); }
29 step del2 { DELETE FROM reind_con_tab WHERE data = 'cccc'; }
30 step end2 { COMMIT; }
31
32 session s3
33 step reindex { REINDEX TABLE CONCURRENTLY reind_con_tab; }
34
35 permutation reindex sel1 upd2 ins2 del2 end1 end2
36 permutation sel1 reindex upd2 ins2 del2 end1 end2
37 permutation sel1 upd2 reindex ins2 del2 end1 end2
38 permutation sel1 upd2 ins2 reindex del2 end1 end2
39 permutation sel1 upd2 ins2 del2 reindex end1 end2
40 permutation sel1 upd2 ins2 del2 end1 reindex end2