Skip to content

Commit 396676b

Browse files
committed
Enforce non-parallel plan when calling current_schema() in newly-added test
current_schema() gets called in the recently-added regression test from c5660e0, and can be used in a parallel context, causing its call to fail when creating a temporary schema. Per buildfarm members crake and lapwing. Discussion: https://postgr.es/m/20190118005949.GD1883@paquier.xyz
1 parent 251f574 commit 396676b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/test/regress/expected/temp.out

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,11 @@ prepare transaction 'twophase_tab';
360360
ERROR: cannot PREPARE a transaction that has operated on temporary tables
361361
-- Corner case: current_schema may create a temporary schema if namespace
362362
-- creation is pending, so check after that. First reset the connection
363-
-- to remove the temporary namespace.
363+
-- to remove the temporary namespace, and make sure that non-parallel plans
364+
-- are used.
364365
\c -
366+
SET max_parallel_workers = 0;
367+
SET max_parallel_workers_per_gather = 0;
365368
SET search_path TO 'pg_temp';
366369
BEGIN;
367370
SELECT current_schema() ~ 'pg_temp' AS is_temp_schema;

src/test/regress/sql/temp.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,11 @@ prepare transaction 'twophase_tab';
274274

275275
-- Corner case: current_schema may create a temporary schema if namespace
276276
-- creation is pending, so check after that. First reset the connection
277-
-- to remove the temporary namespace.
277+
-- to remove the temporary namespace, and make sure that non-parallel plans
278+
-- are used.
278279
\c -
280+
SET max_parallel_workers = 0;
281+
SET max_parallel_workers_per_gather = 0;
279282
SET search_path TO 'pg_temp';
280283
BEGIN;
281284
SELECT current_schema() ~ 'pg_temp' AS is_temp_schema;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy