Re: [COMMITTERS] pgsql: Expand partitioned table RTEs level by level, without flattening

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Robert Haas <robert(dot)haas(at)enterprisedb(dot)com>, Andreas Seltenreich <seltenreich(at)gmx(dot)de>
Subject: Re: [COMMITTERS] pgsql: Expand partitioned table RTEs level by level, without flattening
Date: 2017-09-18 07:30:40
Message-ID: CAFjFpReT9=gazzvYG_qb6fXC-ZxtvTy8faULQKXqh_ogHShK_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Sun, Sep 17, 2017 at 7:24 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Can you debug this on Monday?
>
> ...Robert
>
> Begin forwarded message:
>
> From: Andreas Seltenreich <seltenreich(at)gmx(dot)de>
> Date: September 16, 2017 at 6:55:46 AM EDT
> To: Robert Haas <rhaas(at)postgresql(dot)org>
> Cc: pgsql-committers(at)postgresql(dot)org
> Subject: Re: [COMMITTERS] pgsql: Expand partitioned table RTEs level by
> level, without flattening
>
> Robert Haas writes:
>
> Expand partitioned table RTEs level by level, without flattening.
>
>
> testing with sqlsmith shows that the following assertion in this commit
> doesn't hold:
>
> TRAP: FailedAssertion("!(((brel)->reloptkind == RELOPT_BASEREL ||
> (brel)->reloptkind == RELOPT_OTHER_MEMBER_REL))", File: "initsplan.c", Line:
> 647)
>
> One of the simpler queries that triggers it for me:
>
> select from information_schema.user_mapping_options;

Thanks Andreas for the report. Sorry for the assertion failure.

PFA patch to fix the assertion failure.

The assertion assumed that all relations in simple_rel_array[] were
either "base" relations or "other" relations. This isn't true. The
array can contain "dead" relations as well. I have removed the
assertion and instead fixed the code to skip anything which is not
"base" or "other member rel".

I have also added a test to cover dead relations and lateral
references in join.sql.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

Attachment Content-Type Size
0001-Skip-dead-relations-in-create_lateral_join_info.patch text/x-patch 3.3 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-09-18 10:32:13 Re: Re: [COMMITTERS] pgsql: Perform only one ReadControlFile() during startup.
Previous Message Peter Eisentraut 2017-09-18 02:33:29 pgsql: Fix DROP SUBSCRIPTION hang

Browse pgsql-hackers by date

  From Date Subject
Next Message Mithun Cy 2017-09-18 08:08:18 Re: SendRowDescriptionMessage() is slow for queries with a lot of columns
Previous Message Rushabh Lathia 2017-09-18 07:16:24 Re: GatherMerge misses to push target list