pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andreas Seltenreich <seltenreich@gmx.de>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [sqlsmith] ERROR: plan should not reference subplan's variable
Date: Fri, 01 Jul 2016 18:52:31 -0400
Message-ID: <14046.1467413551@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmobN-FD5vf41H-=eZs_vuwY0JfQ1tK_p-H_Erw9NdiQoqA@mail.gmail.com>
References: <874m89rw7x.fsf@credativ.de>
	<8425.1467408576@sss.pgh.pa.us>
	<CA+TgmobN-FD5vf41H-=eZs_vuwY0JfQ1tK_p-H_Erw9NdiQoqA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Jul 1, 2016 at 5:29 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> ... but if I try to actually execute the query, it crashes at runtime,
>> apparently because the CTE has not been passed over to the parallel
>> worker.  Robert, is it expected that CTEs should be parallel-safe?
>> I'd have thought not.

> Not.  See the RTE_CTE case in set_rel_consider_parallel.

OK; but this is crashing anyway, because after const-simplification the
CTE isn't actually referenced anywhere.  But it still ends up as an
initplan attached to the top plan node.  This may have accidentally
failed to fail before you removed this bit in 5ce5e4a12:

    if (glob->subplans != NULL)
        glob->wholePlanParallelSafe = false;

I think in the current code, the equivalent thing is that we need to
consider that a plan node is parallel-unsafe once we've stuck some
initPlans on it (which happens only in createplan.c and so doesn't affect
the parallel_safe state of the source Path).  Will see if that helps.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (6+ messages)  latest in thread

Message-ID: <14046.1467413551@sss.pgh.pa.us>
Permalink:  ../14046.1467413551@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14046.1467413551@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, seltenreich@gmx.de
  Subject: Re: [sqlsmith] ERROR: plan should not reference subplan's variable
  In-Reply-To: <14046.1467413551@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox