mirror of
https://github.com/postgres/postgres.git
synced 2026-04-21 22:28:15 -04:00
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 741d7f104, 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
129 lines
3.8 KiB
Text
129 lines
3.8 KiB
Text
Parsed test spec with 3 sessions
|
|
|
|
starting permutation: listenc notify1 notify2 notify3 notifyf
|
|
step listenc: LISTEN c1; LISTEN c2;
|
|
step notify1: NOTIFY c1;
|
|
notifier: NOTIFY "c1" with payload "" from notifier
|
|
step notify2: NOTIFY c2, 'payload';
|
|
notifier: NOTIFY "c2" with payload "payload" from notifier
|
|
step notify3: NOTIFY c3, 'payload3';
|
|
step notifyf: SELECT pg_notify('c2', NULL);
|
|
pg_notify
|
|
---------
|
|
|
|
(1 row)
|
|
|
|
notifier: NOTIFY "c2" with payload "" from notifier
|
|
|
|
starting permutation: listenc notifyd1 notifyd2 notifys1
|
|
step listenc: LISTEN c1; LISTEN c2;
|
|
step notifyd1: NOTIFY c2, 'payload'; NOTIFY c1; NOTIFY "c2", 'payload';
|
|
notifier: NOTIFY "c2" with payload "payload" from notifier
|
|
notifier: NOTIFY "c1" with payload "" from notifier
|
|
step notifyd2: NOTIFY c1; NOTIFY c1; NOTIFY c1, 'p1'; NOTIFY c1, 'p2';
|
|
notifier: NOTIFY "c1" with payload "" from notifier
|
|
notifier: NOTIFY "c1" with payload "p1" from notifier
|
|
notifier: NOTIFY "c1" with payload "p2" from notifier
|
|
step notifys1:
|
|
BEGIN;
|
|
NOTIFY c1, 'payload'; NOTIFY "c2", 'payload';
|
|
NOTIFY c1, 'payload'; NOTIFY "c2", 'payload';
|
|
SAVEPOINT s1;
|
|
NOTIFY c1, 'payload'; NOTIFY "c2", 'payload';
|
|
NOTIFY c1, 'payloads'; NOTIFY "c2", 'payloads';
|
|
NOTIFY c1, 'payload'; NOTIFY "c2", 'payload';
|
|
NOTIFY c1, 'payloads'; NOTIFY "c2", 'payloads';
|
|
RELEASE SAVEPOINT s1;
|
|
SAVEPOINT s2;
|
|
NOTIFY c1, 'rpayload'; NOTIFY "c2", 'rpayload';
|
|
NOTIFY c1, 'rpayloads'; NOTIFY "c2", 'rpayloads';
|
|
NOTIFY c1, 'rpayload'; NOTIFY "c2", 'rpayload';
|
|
NOTIFY c1, 'rpayloads'; NOTIFY "c2", 'rpayloads';
|
|
ROLLBACK TO SAVEPOINT s2;
|
|
COMMIT;
|
|
|
|
notifier: NOTIFY "c1" with payload "payload" from notifier
|
|
notifier: NOTIFY "c2" with payload "payload" from notifier
|
|
notifier: NOTIFY "c1" with payload "payload" from notifier
|
|
notifier: NOTIFY "c2" with payload "payload" from notifier
|
|
notifier: NOTIFY "c1" with payload "payloads" from notifier
|
|
notifier: NOTIFY "c2" with payload "payloads" from notifier
|
|
|
|
starting permutation: llisten notify1 notify2 notify3 notifyf lcheck
|
|
step llisten: LISTEN c1; LISTEN c2;
|
|
step notify1: NOTIFY c1;
|
|
step notify2: NOTIFY c2, 'payload';
|
|
step notify3: NOTIFY c3, 'payload3';
|
|
step notifyf: SELECT pg_notify('c2', NULL);
|
|
pg_notify
|
|
---------
|
|
|
|
(1 row)
|
|
|
|
step lcheck: SELECT 1 AS x;
|
|
x
|
|
-
|
|
1
|
|
(1 row)
|
|
|
|
listener: NOTIFY "c1" with payload "" from notifier
|
|
listener: NOTIFY "c2" with payload "payload" from notifier
|
|
listener: NOTIFY "c2" with payload "" from notifier
|
|
|
|
starting permutation: listenc llisten notify1 notify2 notify3 notifyf lcheck
|
|
step listenc: LISTEN c1; LISTEN c2;
|
|
step llisten: LISTEN c1; LISTEN c2;
|
|
step notify1: NOTIFY c1;
|
|
notifier: NOTIFY "c1" with payload "" from notifier
|
|
step notify2: NOTIFY c2, 'payload';
|
|
notifier: NOTIFY "c2" with payload "payload" from notifier
|
|
step notify3: NOTIFY c3, 'payload3';
|
|
step notifyf: SELECT pg_notify('c2', NULL);
|
|
pg_notify
|
|
---------
|
|
|
|
(1 row)
|
|
|
|
notifier: NOTIFY "c2" with payload "" from notifier
|
|
step lcheck: SELECT 1 AS x;
|
|
x
|
|
-
|
|
1
|
|
(1 row)
|
|
|
|
listener: NOTIFY "c1" with payload "" from notifier
|
|
listener: NOTIFY "c2" with payload "payload" from notifier
|
|
listener: NOTIFY "c2" with payload "" from notifier
|
|
|
|
starting permutation: l2listen l2begin notify1 lbegins llisten lcommit l2commit l2stop
|
|
step l2listen: LISTEN c1;
|
|
step l2begin: BEGIN;
|
|
step notify1: NOTIFY c1;
|
|
step lbegins: BEGIN ISOLATION LEVEL SERIALIZABLE;
|
|
step llisten: LISTEN c1; LISTEN c2;
|
|
step lcommit: COMMIT;
|
|
step l2commit: COMMIT;
|
|
listener2: NOTIFY "c1" with payload "" from notifier
|
|
step l2stop: UNLISTEN *;
|
|
|
|
starting permutation: llisten lbegin usage bignotify usage
|
|
step llisten: LISTEN c1; LISTEN c2;
|
|
step lbegin: BEGIN;
|
|
step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero;
|
|
nonzero
|
|
-------
|
|
f
|
|
(1 row)
|
|
|
|
step bignotify: SELECT count(pg_notify('c1', s::text)) FROM generate_series(1, 1000) s;
|
|
count
|
|
-----
|
|
1000
|
|
(1 row)
|
|
|
|
step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero;
|
|
nonzero
|
|
-------
|
|
t
|
|
(1 row)
|
|
|