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

Commit90c1ba5

Browse files
committed
postgres_fdw: Split out the query_cancel test to its own file
This allows us to skip it in Cygwin, where it's reportedly flaky becauseof platform bugs or something.Backpatch to 17, where the test was introduced by commit2466d66.Reported-by: Alexander Lakhin <exclusion@gmail.com>Discussion:https://postgr.es/m/e4d0cb33-6be5-e4d5-ae49-9eac3ff2b005@gmail.com
1 parent683be87 commit90c1ba5

File tree

7 files changed

+37
-25
lines changed

7 files changed

+37
-25
lines changed

‎contrib/postgres_fdw/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SHLIB_LINK_INTERNAL = $(libpq)
1616
EXTENSION = postgres_fdw
1717
DATA = postgres_fdw--1.0.sql postgres_fdw--1.0--1.1.sql
1818

19-
REGRESS = postgres_fdw
19+
REGRESS = postgres_fdw query_cancel
2020

2121
ifdefUSE_PGXS
2222
PG_CONFIG = pg_config

‎contrib/postgres_fdw/expected/postgres_fdw.out

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,22 +2760,6 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c
27602760
(10 rows)
27612761

27622762
ALTER VIEW v4 OWNER TO regress_view_owner;
2763-
-- Make sure this big CROSS JOIN query is pushed down
2764-
EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5;
2765-
QUERY PLAN
2766-
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
2767-
Foreign Scan
2768-
Output: (count(*))
2769-
Relations: Aggregate on ((((public.ft1) INNER JOIN (public.ft2)) INNER JOIN (public.ft4)) INNER JOIN (public.ft5))
2770-
Remote SQL: SELECT count(*) FROM ((("S 1"."T 1" r1 INNER JOIN "S 1"."T 1" r2 ON (TRUE)) INNER JOIN "S 1"."T 3" r4 ON (TRUE)) INNER JOIN "S 1"."T 4" r6 ON (TRUE))
2771-
(4 rows)
2772-
2773-
-- Make sure query cancellation works
2774-
BEGIN;
2775-
SET LOCAL statement_timeout = '10ms';
2776-
select count(*) from ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; -- this takes very long
2777-
ERROR: canceling statement due to statement timeout
2778-
COMMIT;
27792763
-- ====================================================================
27802764
-- Check that userid to use when querying the remote table is correctly
27812765
-- propagated into foreign rels present in subqueries under an UNION ALL
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
SELECT version() ~ 'cygwin' AS skip_test \gset
2+
\if :skip_test
3+
\quit
4+
\endif
5+
-- Make sure this big CROSS JOIN query is pushed down
6+
EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5;
7+
QUERY PLAN
8+
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
9+
Foreign Scan
10+
Output: (count(*))
11+
Relations: Aggregate on ((((public.ft1) INNER JOIN (public.ft2)) INNER JOIN (public.ft4)) INNER JOIN (public.ft5))
12+
Remote SQL: SELECT count(*) FROM ((("S 1"."T 1" r1 INNER JOIN "S 1"."T 1" r2 ON (TRUE)) INNER JOIN "S 1"."T 3" r4 ON (TRUE)) INNER JOIN "S 1"."T 4" r6 ON (TRUE))
13+
(4 rows)
14+
15+
-- Make sure query cancellation works
16+
BEGIN;
17+
SET LOCAL statement_timeout = '10ms';
18+
select count(*) from ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; -- this takes very long
19+
ERROR: canceling statement due to statement timeout
20+
COMMIT;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SELECT version() ~ 'cygwin' AS skip_test \gset
2+
\if :skip_test
3+
\quit

‎contrib/postgres_fdw/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ tests += {
3636
'regress': {
3737
'sql': [
3838
'postgres_fdw',
39+
'query_cancel',
3940
],
4041
'regress_args': ['--dlpath',meson.build_root()/'src/test/regress'],
4142
},

‎contrib/postgres_fdw/sql/postgres_fdw.sql

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -742,14 +742,6 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c
742742
SELECTt1.c1,t2.c2FROM v4 t1LEFT JOIN ft5 t2ON (t1.c1=t2.c1)ORDER BYt1.c1,t2.c1 OFFSET10LIMIT10;
743743
ALTERVIEW v4 OWNER TO regress_view_owner;
744744

745-
-- Make sure this big CROSS JOIN query is pushed down
746-
EXPLAIN (VERBOSE, COSTS OFF)SELECTcount(*)FROM ft1CROSS JOIN ft2CROSS JOIN ft4CROSS JOIN ft5;
747-
-- Make sure query cancellation works
748-
BEGIN;
749-
SET LOCAL statement_timeout='10ms';
750-
selectcount(*)from ft1CROSS JOIN ft2CROSS JOIN ft4CROSS JOIN ft5;-- this takes very long
751-
COMMIT;
752-
753745
-- ====================================================================
754746
-- Check that userid to use when querying the remote table is correctly
755747
-- propagated into foreign rels present in subqueries under an UNION ALL
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
SELECT version() ~'cygwin'AS skip_test \gset
2+
\if :skip_test
3+
\quit
4+
\endif
5+
6+
-- Make sure this big CROSS JOIN query is pushed down
7+
EXPLAIN (VERBOSE, COSTS OFF)SELECTcount(*)FROM ft1CROSS JOIN ft2CROSS JOIN ft4CROSS JOIN ft5;
8+
-- Make sure query cancellation works
9+
BEGIN;
10+
SET LOCAL statement_timeout='10ms';
11+
selectcount(*)from ft1CROSS JOIN ft2CROSS JOIN ft4CROSS JOIN ft5;-- this takes very long
12+
COMMIT;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp