Re: Free indexed_tlist memory explicitly within set_plan_refs()

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Free indexed_tlist memory explicitly within set_plan_refs()
Date: 2015-05-30 08:07:14
Message-ID: CAM3SWZSWvjNC6v=aaQv2C=8zCKpD3y-u2y59vPW5ANXSzftDtQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 28, 2015 at 2:37 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> Attached, revised version incorporates this small fix, while adding an
> additional big fix, and a number of small style tweaks.
>
> This is mainly concerned with fixing the bug I was trying to fix when
> I spotted the minor pfree() issue:
>
> postgres=# insert into upsert (key, val) values('Foo', 'Bar') on
> conflict (key) do update set val = excluded.val where excluded.* is
> not null;
> ERROR: XX000: variable not found in subplan target lists
> LOCATION: fix_join_expr_mutator, setrefs.c:2003

My fix for this issue
(0001-Fix-bug-with-whole-row-Vars-in-excluded-targetlist.patch) still
missed something. There needs to be additional handling in
ruleutils.c:

postgres=# explain insert into upsert as u
values (1, 'fooz') on conflict (key)
do update set val = excluded.val where excluded.* is not null;
ERROR: XX000: bogus varattno for INNER_VAR var: 0
LOCATION: get_variable, ruleutils.c:5904

I'll look for a fix for this additional issue tomorrow.
--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-05-30 08:10:23 Re: cannot set view triggers to replica
Previous Message Michael Paquier 2015-05-30 07:58:57 Re: FPW compression leaks information