Fix regression test for force_parallel_mode=on.
authorRobert Haas <[email protected]>
Wed, 15 Jun 2016 18:59:07 +0000 (14:59 -0400)
committerRobert Haas <[email protected]>
Wed, 15 Jun 2016 18:59:07 +0000 (14:59 -0400)
Commit 14a254fb52423c57059851abafbd1247261f7f03 managed not to
exercise the code it was intended to test, and the comment explaining
why no "parallel worker" line showed up in the context wasn't right.

Amit Kapila, tweaked by me per Amit's analysis.

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

index b19dc1b2f0edec843739c1446631bd87bb7dfc98..709e64e038ee9b6640ff5ae955a81c0e4f8d8fa3 100644 (file)
@@ -44,11 +44,12 @@ explain (costs off)
 
 do $$begin
   -- Provoke error in worker.  The original message CONTEXT contains a worker
-  -- PID that must be hidden in the test output.  PL/pgSQL conveniently
-  -- substitutes its own CONTEXT.
-  select stringu1::int2 from tenk1 where unique1 = 1;
+  -- PID that must be hidden in the test output.
+  perform stringu1::int2 from tenk1 where unique1 = 1;
+  exception
+   when others then
+       raise 'SQLERRM: %', sqlerrm;
 end$$;
-ERROR:  invalid input syntax for integer: "BAAAAA"
-CONTEXT:  SQL statement "select stringu1::int2 from tenk1 where unique1 = 1"
-PL/pgSQL function inline_code_block line 5 at SQL statement
+ERROR:  SQLERRM: invalid input syntax for integer: "BAAAAA"
+CONTEXT:  PL/pgSQL function inline_code_block line 7 at RAISE
 rollback;
index 1cd4a700f19b2fff0f3db1da9061271812f6bf71..ef1884895794a3d4c9e7277abb227b8c16f984db 100644 (file)
@@ -21,9 +21,11 @@ explain (costs off)
 
 do $$begin
   -- Provoke error in worker.  The original message CONTEXT contains a worker
-  -- PID that must be hidden in the test output.  PL/pgSQL conveniently
-  -- substitutes its own CONTEXT.
-  select stringu1::int2 from tenk1 where unique1 = 1;
+  -- PID that must be hidden in the test output.
+  perform stringu1::int2 from tenk1 where unique1 = 1;
+  exception
+   when others then
+       raise 'SQLERRM: %', sqlerrm;
 end$$;
 
 rollback;