Re: [BUG] segfault during delete

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Álvaro Herrera <alvherre@alvh.no-ip.org>
To: "Amit Langote" <amitlangote09@gmail.com>, "Drouvot, Bertrand" <bdrouvot@amazon.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-02-27T21:14:04Z
Lists: pgsql-hackers
Thanks Amit for working on this fix!  It seems correct to me, so I pushed it with trivial changes.  Thanks Bertrand for reporting the problem.

In addition to backpatching the code fix to pg12, I backpatched the test case to pg11. It worked fine for me (with no code changes), but it seems good to have it there just to make sure the buildfarm agrees with us on this.

Commits

  1. Fix use-after-free bug with AfterTriggersTableData.storeslot

  2. Use slots in trigger infrastructure, except for the actual invocation.