Commit 4a054069 authored by Tom Lane's avatar Tom Lane

Improve display of query results in isolation tests.

Previously, isolationtester displayed SQL query results using some
ad-hoc code that clearly hadn't had much effort expended on it.
Field values longer than 14 characters weren't separated from
the next field, and usually caused misalignment of the columns
too.  Also there was no visual separation of a query's result
from subsequent isolationtester output.  This made test result
files confusing and hard to read.

To improve matters, let's use libpq's PQprint() function.  Although
that's long since unused by psql, it's still plenty good enough
for the purpose here.

Like 741d7f10, back-patch to all supported branches, so that this
isn't a stumbling block for back-patching isolation test changes.

Discussion: https://postgr.es/m/582362.1623798221@sss.pgh.pa.us
parent 24043c27
...@@ -10,11 +10,15 @@ step s2_ddl: CREATE TABLE stream_test2(data text); ...@@ -10,11 +10,15 @@ step s2_ddl: CREATE TABLE stream_test2(data text);
step s1_commit: COMMIT; step s1_commit: COMMIT;
step s1_get_stream_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL,NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1'); step s1_get_stream_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL,NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1');
data data
----------------------------------------
opening a streamed block for transaction opening a streamed block for transaction
streaming change for transaction streaming change for transaction
closing a streamed block for transaction closing a streamed block for transaction
committing streamed transaction committing streamed transaction
?column? (4 rows)
?column?
--------
stop stop
(1 row)
...@@ -7,32 +7,44 @@ step s2init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_sl ...@@ -7,32 +7,44 @@ step s2init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_sl
step s1c: COMMIT; step s1c: COMMIT;
step s2init: <... completed> step s2init: <... completed>
?column? ?column?
--------
init init
(1 row)
step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
----
(0 rows)
step s1b: BEGIN ISOLATION LEVEL SERIALIZABLE; step s1b: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s1w: INSERT INTO do_write DEFAULT VALUES; step s1w: INSERT INTO do_write DEFAULT VALUES;
step s1c: COMMIT; step s1c: COMMIT;
step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
--------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:2 table public.do_write: INSERT: id[integer]:2
COMMIT COMMIT
(3 rows)
step s1b: BEGIN ISOLATION LEVEL SERIALIZABLE; step s1b: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s1w: INSERT INTO do_write DEFAULT VALUES; step s1w: INSERT INTO do_write DEFAULT VALUES;
step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
----
(0 rows)
step s1c: COMMIT; step s1c: COMMIT;
step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
--------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:3 table public.do_write: INSERT: id[integer]:3
COMMIT COMMIT
?column? (3 rows)
?column?
--------
stop stop
(1 row)
...@@ -3,64 +3,88 @@ Parsed test spec with 3 sessions ...@@ -3,64 +3,88 @@ Parsed test spec with 3 sessions
starting permutation: s0init s0start s1begin s1sharepgclass s2begin s2sharepgclass s0w s0start s2commit s1commit starting permutation: s0init s0start s1begin s1sharepgclass s2begin s2sharepgclass s0w s0start s2commit s1commit
step s0init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); step s0init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding');
?column? ?column?
--------
init init
(1 row)
step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
----
(0 rows)
step s1begin: BEGIN; step s1begin: BEGIN;
step s1sharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR SHARE) s; step s1sharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR SHARE) s;
?column? ?column?
--------
t t
(1 row)
step s2begin: BEGIN; step s2begin: BEGIN;
step s2sharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR SHARE) s; step s2sharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR SHARE) s;
?column? ?column?
--------
t t
(1 row)
step s0w: INSERT INTO do_write DEFAULT VALUES; step s0w: INSERT INTO do_write DEFAULT VALUES;
step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
--------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:1 table public.do_write: INSERT: id[integer]:1
COMMIT COMMIT
(3 rows)
step s2commit: COMMIT; step s2commit: COMMIT;
step s1commit: COMMIT; step s1commit: COMMIT;
?column? ?column?
--------
stop stop
(1 row)
starting permutation: s0init s0start s1begin s1keysharepgclass s2begin s2keysharepgclass s0alter s0w s0start s2commit s1commit starting permutation: s0init s0start s1begin s1keysharepgclass s2begin s2keysharepgclass s0alter s0w s0start s2commit s1commit
step s0init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); step s0init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding');
?column? ?column?
--------
init init
(1 row)
step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
----
(0 rows)
step s1begin: BEGIN; step s1begin: BEGIN;
step s1keysharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR KEY SHARE) s; step s1keysharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR KEY SHARE) s;
?column? ?column?
--------
t t
(1 row)
step s2begin: BEGIN; step s2begin: BEGIN;
step s2keysharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR KEY SHARE) s; step s2keysharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR KEY SHARE) s;
?column? ?column?
--------
t t
(1 row)
step s0alter: ALTER TABLE do_write ADD column ts timestamptz; step s0alter: ALTER TABLE do_write ADD column ts timestamptz;
step s0w: INSERT INTO do_write DEFAULT VALUES; step s0w: INSERT INTO do_write DEFAULT VALUES;
step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
------------------------------------------------------------------------------
BEGIN BEGIN
COMMIT COMMIT
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:1 ts[timestamp with time zone]:null table public.do_write: INSERT: id[integer]:1 ts[timestamp with time zone]:null
COMMIT COMMIT
(5 rows)
step s2commit: COMMIT; step s2commit: COMMIT;
step s1commit: COMMIT; step s1commit: COMMIT;
?column? ?column?
--------
stop stop
(1 row)
...@@ -4,8 +4,10 @@ starting permutation: s0_begin s0_getxid s1_begin s1_insert s0_alter s0_commit s ...@@ -4,8 +4,10 @@ starting permutation: s0_begin s0_getxid s1_begin s1_insert s0_alter s0_commit s
step s0_begin: BEGIN; step s0_begin: BEGIN;
step s0_getxid: SELECT pg_current_xact_id() IS NULL; step s0_getxid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f f
(1 row)
step s1_begin: BEGIN; step s1_begin: BEGIN;
step s1_insert: INSERT INTO harvest VALUES ((1, 2, 3)); step s1_insert: INSERT INTO harvest VALUES ((1, 2, 3));
step s0_alter: ALTER TYPE basket DROP ATTRIBUTE mangos; step s0_alter: ALTER TYPE basket DROP ATTRIBUTE mangos;
...@@ -13,18 +15,26 @@ step s0_commit: COMMIT; ...@@ -13,18 +15,26 @@ step s0_commit: COMMIT;
step s0_checkpoint: CHECKPOINT; step s0_checkpoint: CHECKPOINT;
step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
----
(0 rows)
step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
----
(0 rows)
step s1_commit: COMMIT; step s1_commit: COMMIT;
step s0_vacuum: VACUUM pg_attribute; step s0_vacuum: VACUUM pg_attribute;
step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
------------------------------------------------------
BEGIN BEGIN
table public.harvest: INSERT: fruits[basket]:'(1,2,3)' table public.harvest: INSERT: fruits[basket]:'(1,2,3)'
COMMIT COMMIT
?column? (3 rows)
?column?
--------
stop stop
(1 row)
...@@ -4,41 +4,51 @@ starting permutation: s2b s2txid s1init s3b s3txid s2alter s2c s2b s2txid s3c s2 ...@@ -4,41 +4,51 @@ starting permutation: s2b s2txid s1init s3b s3txid s2alter s2c s2b s2txid s3c s2
step s2b: BEGIN; step s2b: BEGIN;
step s2txid: SELECT pg_current_xact_id() IS NULL; step s2txid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f f
(1 row)
step s1init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); <waiting ...> step s1init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); <waiting ...>
step s3b: BEGIN; step s3b: BEGIN;
step s3txid: SELECT pg_current_xact_id() IS NULL; step s3txid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f f
(1 row)
step s2alter: ALTER TABLE do_write ADD COLUMN addedbys2 int; step s2alter: ALTER TABLE do_write ADD COLUMN addedbys2 int;
step s2c: COMMIT; step s2c: COMMIT;
step s2b: BEGIN; step s2b: BEGIN;
step s2txid: SELECT pg_current_xact_id() IS NULL; step s2txid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f f
(1 row)
step s3c: COMMIT; step s3c: COMMIT;
step s1init: <... completed> step s1init: <... completed>
?column? ?column?
--------
init init
(1 row)
step s2c: COMMIT; step s2c: COMMIT;
step s1insert: INSERT INTO do_write DEFAULT VALUES; step s1insert: INSERT INTO do_write DEFAULT VALUES;
step s1checkpoint: CHECKPOINT; step s1checkpoint: CHECKPOINT;
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
--------------------------------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:1 addedbys2[integer]:null table public.do_write: INSERT: id[integer]:1 addedbys2[integer]:null
COMMIT COMMIT
(3 rows)
step s1insert: INSERT INTO do_write DEFAULT VALUES; step s1insert: INSERT INTO do_write DEFAULT VALUES;
step s1alter: ALTER TABLE do_write ADD COLUMN addedbys1 int; step s1alter: ALTER TABLE do_write ADD COLUMN addedbys1 int;
step s1insert: INSERT INTO do_write DEFAULT VALUES; step s1insert: INSERT INTO do_write DEFAULT VALUES;
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
--------------------------------------------------------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:2 addedbys2[integer]:null table public.do_write: INSERT: id[integer]:2 addedbys2[integer]:null
COMMIT COMMIT
...@@ -47,6 +57,10 @@ COMMIT ...@@ -47,6 +57,10 @@ COMMIT
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:3 addedbys2[integer]:null addedbys1[integer]:null table public.do_write: INSERT: id[integer]:3 addedbys2[integer]:null addedbys1[integer]:null
COMMIT COMMIT
?column? (8 rows)
?column?
--------
stop stop
(1 row)
...@@ -5,8 +5,10 @@ step s0_begin: BEGIN; ...@@ -5,8 +5,10 @@ step s0_begin: BEGIN;
step s0_begin_sub0: SAVEPOINT s0; step s0_begin_sub0: SAVEPOINT s0;
step s0_log_assignment: SELECT pg_current_xact_id() IS NULL; step s0_log_assignment: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f f
(1 row)
step s0_sub_get_base_snap: INSERT INTO dummy VALUES (0); step s0_sub_get_base_snap: INSERT INTO dummy VALUES (0);
step s1_produce_new_snap: ALTER TABLE harvest ADD COLUMN mangos int; step s1_produce_new_snap: ALTER TABLE harvest ADD COLUMN mangos int;
step s0_insert: INSERT INTO harvest VALUES (1, 2, 3); step s0_insert: INSERT INTO harvest VALUES (1, 2, 3);
...@@ -14,22 +16,28 @@ step s0_end_sub0: RELEASE SAVEPOINT s0; ...@@ -14,22 +16,28 @@ step s0_end_sub0: RELEASE SAVEPOINT s0;
step s0_commit: COMMIT; step s0_commit: COMMIT;
step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
----------------------------------------------------------------------------------
BEGIN BEGIN
table public.dummy: INSERT: i[integer]:0 table public.dummy: INSERT: i[integer]:0
table public.harvest: INSERT: apples[integer]:1 pears[integer]:2 mangos[integer]:3 table public.harvest: INSERT: apples[integer]:1 pears[integer]:2 mangos[integer]:3
COMMIT COMMIT
?column? (4 rows)
?column?
--------
stop stop
(1 row)
starting permutation: s0_begin s0_begin_sub0 s0_log_assignment s0_begin_sub1 s0_sub_get_base_snap s1_produce_new_snap s0_insert s0_end_sub1 s0_end_sub0 s0_commit s0_get_changes starting permutation: s0_begin s0_begin_sub0 s0_log_assignment s0_begin_sub1 s0_sub_get_base_snap s1_produce_new_snap s0_insert s0_end_sub1 s0_end_sub0 s0_commit s0_get_changes
step s0_begin: BEGIN; step s0_begin: BEGIN;
step s0_begin_sub0: SAVEPOINT s0; step s0_begin_sub0: SAVEPOINT s0;
step s0_log_assignment: SELECT pg_current_xact_id() IS NULL; step s0_log_assignment: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f f
(1 row)
step s0_begin_sub1: SAVEPOINT s1; step s0_begin_sub1: SAVEPOINT s1;
step s0_sub_get_base_snap: INSERT INTO dummy VALUES (0); step s0_sub_get_base_snap: INSERT INTO dummy VALUES (0);
step s1_produce_new_snap: ALTER TABLE harvest ADD COLUMN mangos int; step s1_produce_new_snap: ALTER TABLE harvest ADD COLUMN mangos int;
...@@ -39,11 +47,15 @@ step s0_end_sub0: RELEASE SAVEPOINT s0; ...@@ -39,11 +47,15 @@ step s0_end_sub0: RELEASE SAVEPOINT s0;
step s0_commit: COMMIT; step s0_commit: COMMIT;
step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
----------------------------------------------------------------------------------
BEGIN BEGIN
table public.dummy: INSERT: i[integer]:0 table public.dummy: INSERT: i[integer]:0
table public.harvest: INSERT: apples[integer]:1 pears[integer]:2 mangos[integer]:3 table public.harvest: INSERT: apples[integer]:1 pears[integer]:2 mangos[integer]:3
COMMIT COMMIT
?column? (4 rows)
?column?
--------
stop stop
(1 row)
...@@ -16,24 +16,34 @@ step s1_begin: BEGIN; ...@@ -16,24 +16,34 @@ step s1_begin: BEGIN;
step s1_dml: INSERT INTO harvest VALUES (43); step s1_dml: INSERT INTO harvest VALUES (43);
step s0_many_subxacts: select subxacts(); step s0_many_subxacts: select subxacts();
subxacts subxacts
--------
(1 row)
step s0_commit: COMMIT; step s0_commit: COMMIT;
step s2_checkpoint: CHECKPOINT; step s2_checkpoint: CHECKPOINT;
step s2_get_changes_suppress_output: SELECT null n FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1') GROUP BY n; step s2_get_changes_suppress_output: SELECT null n FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1') GROUP BY n;
n n
-
(1 row)
step s2_get_changes_suppress_output: SELECT null n FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1') GROUP BY n; step s2_get_changes_suppress_output: SELECT null n FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1') GROUP BY n;
n n
-
(0 rows)
step s1_commit: COMMIT; step s1_commit: COMMIT;
step s2_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s2_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
------------------------------------------------
BEGIN BEGIN
table public.harvest: INSERT: apples[integer]:43 table public.harvest: INSERT: apples[integer]:43
COMMIT COMMIT
?column? (3 rows)
?column?
--------
stop stop
(1 row)
...@@ -4,14 +4,18 @@ starting permutation: s2b s2txid s1init s3b s3txid s2c s2b s2insert s2p s3c s1in ...@@ -4,14 +4,18 @@ starting permutation: s2b s2txid s1init s3b s3txid s2c s2b s2insert s2p s3c s1in
step s2b: BEGIN; step s2b: BEGIN;
step s2txid: SELECT pg_current_xact_id() IS NULL; step s2txid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f f
(1 row)
step s1init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding', false, true); <waiting ...> step s1init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding', false, true); <waiting ...>
step s3b: BEGIN; step s3b: BEGIN;
step s3txid: SELECT pg_current_xact_id() IS NULL; step s3txid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f f
(1 row)
step s2c: COMMIT; step s2c: COMMIT;
step s2b: BEGIN; step s2b: BEGIN;
step s2insert: INSERT INTO do_write DEFAULT VALUES; step s2insert: INSERT INTO do_write DEFAULT VALUES;
...@@ -19,23 +23,31 @@ step s2p: PREPARE TRANSACTION 'test1'; ...@@ -19,23 +23,31 @@ step s2p: PREPARE TRANSACTION 'test1';
step s3c: COMMIT; step s3c: COMMIT;
step s1init: <... completed> step s1init: <... completed>
?column? ?column?
--------
init init
(1 row)
step s1insert: INSERT INTO do_write DEFAULT VALUES; step s1insert: INSERT INTO do_write DEFAULT VALUES;
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1');
data data
--------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:2 table public.do_write: INSERT: id[integer]:2
COMMIT COMMIT
(3 rows)
step s2cp: COMMIT PREPARED 'test1'; step s2cp: COMMIT PREPARED 'test1';
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1');
data data
--------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:1 table public.do_write: INSERT: id[integer]:1
PREPARE TRANSACTION 'test1' PREPARE TRANSACTION 'test1'
COMMIT PREPARED 'test1' COMMIT PREPARED 'test1'
?column? (4 rows)
?column?
--------
stop stop
(1 row)
...@@ -5,14 +5,18 @@ step s1s: SAVEPOINT f; ...@@ -5,14 +5,18 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
starting permutation: s1s s1u s1r s1l s2l s1c s2c starting permutation: s1s s1u s1r s1l s2l s1c s2c
...@@ -20,13 +24,17 @@ step s1s: SAVEPOINT f; ...@@ -20,13 +24,17 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
step s2c: COMMIT; step s2c: COMMIT;
...@@ -35,13 +43,17 @@ step s1s: SAVEPOINT f; ...@@ -35,13 +43,17 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1c: COMMIT; step s1c: COMMIT;
...@@ -50,13 +62,17 @@ step s1s: SAVEPOINT f; ...@@ -50,13 +62,17 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
step s2c: COMMIT; step s2c: COMMIT;
...@@ -65,13 +81,17 @@ step s1s: SAVEPOINT f; ...@@ -65,13 +81,17 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1c: COMMIT; step s1c: COMMIT;
...@@ -80,14 +100,18 @@ step s1s: SAVEPOINT f; ...@@ -80,14 +100,18 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s1s s1u s2l s1r s1l s1c s2c starting permutation: s1s s1u s2l s1r s1l s1c s2c
...@@ -96,13 +120,17 @@ step s1u: UPDATE foo SET key = 2; ...@@ -96,13 +120,17 @@ step s1u: UPDATE foo SET key = 2;
step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...> step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
step s2c: COMMIT; step s2c: COMMIT;
...@@ -112,13 +140,17 @@ step s1u: UPDATE foo SET key = 2; ...@@ -112,13 +140,17 @@ step s1u: UPDATE foo SET key = 2;
step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...> step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1c: COMMIT; step s1c: COMMIT;
...@@ -128,89 +160,113 @@ step s1u: UPDATE foo SET key = 2; ...@@ -128,89 +160,113 @@ step s1u: UPDATE foo SET key = 2;
step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...> step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s1s s2l s1u s2c s1r s1l s1c starting permutation: s1s s2l s1u s2c s1r s1l s1c
step s1s: SAVEPOINT f; step s1s: SAVEPOINT f;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1u: UPDATE foo SET key = 2; <waiting ...> step s1u: UPDATE foo SET key = 2; <waiting ...>
step s2c: COMMIT; step s2c: COMMIT;
step s1u: <... completed> step s1u: <... completed>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s1s s2l s2c s1u s1r s1l s1c starting permutation: s1s s2l s2c s1u s1r s1l s1c
step s1s: SAVEPOINT f; step s1s: SAVEPOINT f;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s2l s1s s1u s2c s1r s1l s1c starting permutation: s2l s1s s1u s2c s1r s1l s1c
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1s: SAVEPOINT f; step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; <waiting ...> step s1u: UPDATE foo SET key = 2; <waiting ...>
step s2c: COMMIT; step s2c: COMMIT;
step s1u: <... completed> step s1u: <... completed>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s2l s1s s2c s1u s1r s1l s1c starting permutation: s2l s1s s2c s1u s1r s1l s1c
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1s: SAVEPOINT f; step s1s: SAVEPOINT f;
step s2c: COMMIT; step s2c: COMMIT;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s2l s2c s1s s1u s1r s1l s1c starting permutation: s2l s2c s1s s1u s1r s1l s1c
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1s: SAVEPOINT f; step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
...@@ -15,8 +15,10 @@ step s1b: begin; ...@@ -15,8 +15,10 @@ step s1b: begin;
step s1d: delete from ppk where a = 1; step s1d: delete from ppk where a = 1;
step s2bs: begin isolation level serializable; select 1; step s2bs: begin isolation level serializable; select 1;
?column? ?column?
--------
1
(1 row)
1
step s2i: insert into pfk values (1); <waiting ...> step s2i: insert into pfk values (1); <waiting ...>
step s1c: commit; step s1c: commit;
step s2i: <... completed> step s2i: <... completed>
...@@ -37,8 +39,10 @@ starting permutation: s1b s2bs s1d s2i s1c s2c ...@@ -37,8 +39,10 @@ starting permutation: s1b s2bs s1d s2i s1c s2c
step s1b: begin; step s1b: begin;
step s2bs: begin isolation level serializable; select 1; step s2bs: begin isolation level serializable; select 1;
?column? ?column?
--------
1
(1 row)
1
step s1d: delete from ppk where a = 1; step s1d: delete from ppk where a = 1;
step s2i: insert into pfk values (1); <waiting ...> step s2i: insert into pfk values (1); <waiting ...>
step s1c: commit; step s1c: commit;
...@@ -60,8 +64,10 @@ starting permutation: s1b s2bs s2i s1d s2c s1c ...@@ -60,8 +64,10 @@ starting permutation: s1b s2bs s2i s1d s2c s1c
step s1b: begin; step s1b: begin;
step s2bs: begin isolation level serializable; select 1; step s2bs: begin isolation level serializable; select 1;
?column? ?column?
--------
1
(1 row)
1
step s2i: insert into pfk values (1); step s2i: insert into pfk values (1);
step s1d: delete from ppk where a = 1; <waiting ...> step s1d: delete from ppk where a = 1; <waiting ...>
step s2c: commit; step s2c: commit;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment