pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
inheritance_planner() bug in 9.1
2+ messages / 2 participants
[nested] [flat]

* inheritance_planner() bug in 9.1
@ 2011-01-12 22:52 Jeff Davis <pgsql@j-davis.com>
  2011-01-13 01:26 ` Re: inheritance_planner() bug in 9.1 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Jeff Davis @ 2011-01-12 22:52 UTC (permalink / raw)
  To: pgsql-bugs

The attached SQL causes a crash in 9.1. It appears to be caused by:

    d1001a78ce612a16ea622b558f5fc2b68c45ab4c

The patch tries to copy all of the important data out of the child
context before it's reset; but it doesn't get everything. For instance,
grouping_planner() allocates subroot.glob->paramlist, and uses it in
subsequent iterations; but that isn't copied before the context is
reset. It looks like there are other things that need copying as well,
but it wasn't immediately clear to me what the best fix is.

Regards,
	Jeff Davis

Attachments:

crash2.sql (text/x-sql, 147B) download begin; create table parent1( a int); create table child1 ( b int) inherits(parent1); DELETE FROM parent1 USING (SELECT (SELECT a FROM parent1)) s;
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: inheritance_planner() bug in 9.1
  2011-01-12 22:52 inheritance_planner() bug in 9.1 Jeff Davis <pgsql@j-davis.com>
@ 2011-01-13 01:26 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2011-01-13 01:26 UTC (permalink / raw)
  To: Jeff Davis <pgsql@j-davis.com>; +Cc: pgsql-bugs

Jeff Davis <pgsql@j-davis.com> writes:
> The attached SQL causes a crash in 9.1. It appears to be caused by:
>     d1001a78ce612a16ea622b558f5fc2b68c45ab4c

> The patch tries to copy all of the important data out of the child
> context before it's reset; but it doesn't get everything. For instance,
> grouping_planner() allocates subroot.glob->paramlist, and uses it in
> subsequent iterations; but that isn't copied before the context is
> reset. It looks like there are other things that need copying as well,
> but it wasn't immediately clear to me what the best fix is.

Ugh.  Maybe the best fix is to back that out.  I too am now unsure which
substructures of PlannerGlobal are at risk, and I don't really think
that hack was worth taking any risk of destabilizing the system for.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-01-13 01:26 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-01-12 22:52 inheritance_planner() bug in 9.1 Jeff Davis <pgsql@j-davis.com>
2011-01-13 01:26 ` Tom Lane <tgl@sss.pgh.pa.us>

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