Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit103512c

Browse files
committed
Attempt to fix broken regression test.
In commit8c1d9d5, I attempted toadd a regression test that would fail if the target list was pushedinto a parallel worker, but due to brain fade on my part, it justrandomly fails whether anything bad or not, because the error checkinside the parallel_restricted() function tests whether there is*any process in the system* that is not connected to a client, notwhether the process running the query is not connected to a client.A little experimentation has left me pessimistic about theprospects of doing better here in a short amount of time, so let'sjust fall back to checking that the plan is as we expect and leavethe execution-time check for another day.
1 parent4c56f32 commit103512c

File tree

2 files changed

+4
-39
lines changed

2 files changed

+4
-39
lines changed

‎src/test/regress/expected/select_parallel.out

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
--
22
-- PARALLEL
33
--
4-
create or replace function parallel_restricted(int) returns int as $$
5-
begin
6-
perform * from pg_stat_activity where client_port is null;
7-
if (found) then
8-
raise 'parallel restricted function run in worker';
9-
end if;
10-
return $1;
11-
end$$ language plpgsql parallel restricted;
4+
create or replace function parallel_restricted(int) returns int as
5+
$$begin return $1; end$$ language plpgsql parallel restricted;
126
-- Serializable isolation would disable parallel query, so explicitly use an
137
-- arbitrary other level.
148
begin isolation level repeatable read;
@@ -57,27 +51,6 @@ select parallel_restricted(unique1) from tenk1
5751
Filter: (tenk1.stringu1 = 'GRAAAA'::name)
5852
(9 rows)
5953

60-
select parallel_restricted(unique1) from tenk1
61-
where stringu1 = 'GRAAAA' order by 1;
62-
parallel_restricted
63-
---------------------
64-
448
65-
1124
66-
1800
67-
2476
68-
3152
69-
3828
70-
4504
71-
5180
72-
5856
73-
6532
74-
7208
75-
7884
76-
8560
77-
9236
78-
9912
79-
(15 rows)
80-
8154
set force_parallel_mode=1;
8255
explain (costs off)
8356
select stringu1::int2 from tenk1 where unique1 = 1;

‎src/test/regress/sql/select_parallel.sql

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
-- PARALLEL
33
--
44

5-
create or replacefunctionparallel_restricted(int) returnsintas $$
6-
begin
7-
perform*from pg_stat_activitywhere client_port isnull;
8-
if (found) then
9-
raise'parallel restricted function run in worker';
10-
end if;
11-
return $1;
12-
end$$ language plpgsql parallel restricted;
5+
create or replacefunctionparallel_restricted(int) returnsintas
6+
$$begin return $1; end$$ language plpgsql parallel restricted;
137

148
-- Serializable isolation would disable parallel query, so explicitly use an
159
-- arbitrary other level.
@@ -29,8 +23,6 @@ alter table tenk1 set (parallel_workers = 4);
2923
explain (verbose, costs off)
3024
select parallel_restricted(unique1)from tenk1
3125
where stringu1='GRAAAA'order by1;
32-
select parallel_restricted(unique1)from tenk1
33-
where stringu1='GRAAAA'order by1;
3426

3527
set force_parallel_mode=1;
3628

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp