blob: 3ea301bf543e5e3a85fe6b9ca266e64bbefcc48f [file] [log] [blame]
-- @Description Tests that a update operation in progress will block all other updates
-- until the transaction is committed.
--
DROP TABLE IF EXISTS ao;
CREATE TABLE ao (a INT, b INT) USING @amname@;
INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i;
-- The actual test begins
1: BEGIN;
2: BEGIN;
2: UPDATE ao SET b = 42 WHERE a = 2;
2: SELECT * FROM locktest_master WHERE coalesce = 'ao';
2: SELECT * FROM locktest_segments WHERE coalesce = 'ao';
-- The case here should update a tuple at the same seg with(2).
-- Under jump hash, (2) and (3) are on the same seg(seg0).
1&: UPDATE ao SET b = 42 WHERE a = 3;
2: COMMIT;
1<:
1: COMMIT;
3: SELECT * FROM ao WHERE a < 5 ORDER BY a;
0U: SELECT * FROM gp_toolkit.__gp_aovisimap('ao');