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

Commitecf741c

Browse files
committed
Stabilize postgres_fdw test
The test fails when RESET statement_timeout takes longer than 10ms.Avoid the problem by using SET LOCAL instead.Overall, this test is not ideal: 10ms could be shorter than the time tohave sent the query to the "remote" server, so it's possible that onsome machines this test doesn't actually witness a remote query beingcancelled. We may want to improve on this someday by using some othertesting technique, but for now it's better than nothing. I verifiedmanually that one round of remote cancellation occurs when this runs onmy machine.Discussion:https://postgr.es/m/CAGECzQRsdWnj=YaaPCnA8d7E1AdbxRPBYmyBQRMPUijR2MpM_w@mail.gmail.com
1 parent056c565 commitecf741c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎contrib/postgres_fdw/expected/postgres_fdw.out

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2750,10 +2750,11 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 CROSS JOIN ft2 CROSS JOIN
27502750
(4 rows)
27512751

27522752
-- Make sure query cancellation works
2753-
SET statement_timeout = '10ms';
2753+
BEGIN;
2754+
SET LOCAL statement_timeout = '10ms';
27542755
select count(*) from ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; -- this takes very long
27552756
ERROR: canceling statement due to statement timeout
2756-
RESET statement_timeout;
2757+
COMMIT;
27572758
-- ====================================================================
27582759
-- Check that userid to use when querying the remote table is correctly
27592760
-- propagated into foreign rels present in subqueries under an UNION ALL

‎contrib/postgres_fdw/sql/postgres_fdw.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,10 @@ ALTER VIEW v4 OWNER TO regress_view_owner;
740740
-- Make sure this big CROSS JOIN query is pushed down
741741
EXPLAIN (VERBOSE, COSTS OFF)SELECTcount(*)FROM ft1CROSS JOIN ft2CROSS JOIN ft4CROSS JOIN ft5;
742742
-- Make sure query cancellation works
743-
SET statement_timeout='10ms';
743+
BEGIN;
744+
SET LOCAL statement_timeout='10ms';
744745
selectcount(*)from ft1CROSS JOIN ft2CROSS JOIN ft4CROSS JOIN ft5;-- this takes very long
745-
RESET statement_timeout;
746+
COMMIT;
746747

747748
-- ====================================================================
748749
-- Check that userid to use when querying the remote table is correctly

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp