Re: pgsql: Make Vars be outer-join-aware.

From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Make Vars be outer-join-aware.
Date: 2023-01-31 07:24:40
Message-ID: CAEP4nAz7Enq3+DEthGG7j27DpuwSRZnW0Nh6jtNh75yErQ_nbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Hi Tom,

On Tue, 31 Jan 2023 at 05:43, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Make Vars be outer-join-aware.
>

Since this commit, my test setup is triggering asserts every few minutes.
The repro SQL itself doesn't make much sense, but it's the smallest I could
narrow it down to:

create table t1(a int);
create table t2(a int);
SELECT table_catalog AS c2
FROM public.t1
INNER JOIN (t2
LEFT JOIN information_schema.column_udt_usage ON NULL)
ON NULL;

Sample backtrace (can provide full backtrace if it helps):

Core was generated by `postgres: 8c1cd726c5(at)master@sqith: u76 postgres
127.0.0.1(55412) SELECT '.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig(at)entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#0 __GI_raise (sig=sig(at)entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f4e32fbf859 in __GI_abort () at abort.c:79
#2 0x000055bc9fb256bf in ExceptionalCondition (
conditionName=0x55bc9fcdaaf1 "phv->phnullingrels == NULL",
fileName=0x55bc9fcda72f "setrefs.c", lineNumber=2208) at assert.c:66
#3 0x000055bc9f8147a4 in fix_scan_expr_mutator (node=0x55bca21c78b0,
context=0x7fff72760960) at setrefs.c:2208
#4 0x000055bc9f768081 in expression_tree_mutator_impl (node=0x55bca21c9dc0,
mutator=0x55bc9f8144a2 <fix_scan_expr_mutator>, context=0x7fff72760960)
at nodeFuncs.c:3051
#5 0x000055bc9f81482c in fix_scan_expr_mutator (node=0x55bca21c9dc0,
context=0x7fff72760960) at setrefs.c:2217
#6 0x000055bc9f76848c in expression_tree_mutator_impl (node=0x55bca21c9e10,
mutator=0x55bc9f8144a2 <fix_scan_expr_mutator>, context=0x7fff72760960)
at nodeFuncs.c:3137
#7 0x000055bc9f81482c in fix_scan_expr_mutator (node=0x55bca21c9e10,
context=0x7fff72760960) at setrefs.c:2217
#8 0x000055bc9f814473 in fix_scan_expr (root=0x55bca217e358,
node=0x55bca21c9e10, rtoffset=1, num_exec=0) at setrefs.c:2127

TRAP: failed Assert("phv->phnullingrels == NULL"), File: "setrefs.c",
Line: 2208, PID: 1045580

Thanks to SQLSmith / SQLReduce for help on this.

-
Robins Tharakan
Amazon Web Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2023-01-31 14:50:28 Re: pgsql: Make Vars be outer-join-aware.
Previous Message Michael Paquier 2023-01-31 06:25:20 pgsql: Generate code for query jumbling through gen_node_support.pl