Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--
-- This test checks that lookup_type_cache() can correctly handle an
-- interruption.  We use the injection point to simulate an error but note
-- that a similar situation could happen due to user query interruption.
-- Despite the interruption, a map entry from the relation oid to type cache
-- entry should be created.  This is validated by subsequent modification of
-- the table schema, then type casts which use new schema implying
-- successful type cache invalidation by relation oid.
--
 
CREATE EXTENSION injection_points;
 
-- Make all injection points local to this process, for concurrency.
SELECT injection_points_set_local();
 
CREATE TABLE t (i int);
SELECT injection_points_attach('typecache-before-rel-type-cache-insert', 'error');
SELECT '(1)'::t;
SELECT injection_points_detach('typecache-before-rel-type-cache-insert');
ALTER TABLE t ADD COLUMN j int;
SELECT '(1,2)'::t;
 
DROP EXTENSION injection_points;